Getting rsync to delete files from the *sender* after transfer
5,554
(answering my own question here :) )
The --remove-source-files
will do this. :)
Related videos on Youtube
Author by
Araejay
Updated on September 17, 2022Comments
-
Araejay over 1 year
I'm using rsync to move one directory to another. Is there some way to get rsync to incrementally delete a file from the sender after it has copied it to the reciever?
-
shgnInc over 9 yearsThank you. By this option files just delete. How to delete directories with file deletion?
-
sbussetti about 3 years@shgnInc -- there's no option in rsync that will prune the empty directories for you. Use something like
find /your/path -type d -empty -exec rm -rf {} \;
after rsync is done to prune empty directories.