Difference between revisions of "Rsync"

From DevOps Notebook
 
Line 6: Line 6:
 
=== Faster delete (then rm -r) of many small files with rsync ===
 
=== Faster delete (then rm -r) of many small files with rsync ===
 
<pre>
 
<pre>
mkdir empty_dir
+
$ mkdir empty_dir
# rsync -a --delete empty_dir/    mydirfordeletion/
+
$ rsync -a --delete empty_dir/    mydirfordeletion/
 
</pre>
 
</pre>

Latest revision as of 14:48, 25 October 2023

Copy files and directories and removed source with rsync

$ rsync --remove-source-files -rltv --progress /backup/fullbackup-20210524 /mnt/backup/2021/05/24/

Faster delete (then rm -r) of many small files with rsync

$ mkdir empty_dir
$ rsync -a --delete empty_dir/    mydirfordeletion/