rsync: Delete Source File After Transfer

would like to move all desktop:~/Downloads/*.avi files from my desktop to laptop:~/Download/ using rsync. How do I delete source file after successful transfer is done using rsync command under BSD/Unix/Linux/Apple OS X operating systems?

Asked on December 28, 2020 in program.

Delete source after successful transfer using rsync

The syntax is:

rsync --remove-source-files -options /path/to/src/ /path/to/dest
rsync --remove-source-files -options /path/to/src/ computerB:/path/to/dest
rsync --remove-source-files -av /path/to/src/*.avi computerB:/path/to/dest

You can always perform a trial run with no changes made using --dry-run option:

rsync --dry-run --remove-source-files -azv /path/to/Download/*.avi laptop:~/Download

If you like output run the final command without --dry-run option:

rsync --remove-source-files -azv /path/to/Download/*.avi laptop:~/Download
on December 28, 2020.
Add Comment
0 Answer(s)

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.