Re: mv command behavior

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Peter Lauri wrote:
I would suggest rsync for this task.  You could use it to sync
/tmp/dirA/dirB with /dirC/dirB, deleting files not in /tmp/dirA/dirB
from /dirC/dirB something like this:

$ rsync -av --delete /tmp/dirA/dirB/ /dirC/dirB/

The trailing slashes are significant, so check out the rsync man page
for more details.


[Peter Lauri - DWS Asia]
Hi,

But I just want to perform a simple move. This will perform a copy of the
files, and remove files in /dirC/dirB that should still be there.

After the copy of the file is completed, the file in the SOURCE should be
deleted. But --delete will delete files from the DESTINATION that are not in
SOURCE, so the complete opposite of what I want :)

I assume I have to write my own script for this that copies FILE BY FILE and
checks if it was copied correctly, and then delete it from the tmp dir.

Rsync will do the copy - and it does it in such a way that incomplete copies don't show up. After an rsync run your script can just get the list of files from the destination directory and remove them from the source - unless the source directory is concurrently updated with new files of the same name.

--
  Les Mikesell
   lesmikesell@xxxxxxxxx

--
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux