Saturday, May 4, 2024
 Popular · Latest · Hot · Upcoming
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 1379  / 2 Years ago, mon, september 19, 2022, 11:08:04

I have been trying to run rsync as follows;


rsync -av --exclude '/home/joe/VirtualBox*' /dst

where VirtualBox* denotes all files and directories under the directory 'VirtualBox VMs'


However, it does not appear how I specify this --exclude option, rsync tries to backup everything under the 'VirtualBox VMs' directory.


Tried using --exclude= , --exclude={ } but the result is the same.


Any ideas what I am doing wrong here?


More From » backup

 Answers
4

The exclude option of rsync works on relative paths not absolute ones. So for your example something like the following will work:


rsync -avz --exclude 'directory' source_directory/ destination_directory/

In this generic example you can see that --exclude 'directory' assumes that directory is a sub-directory of source_directory.


I have included the -z option for the rsync line, compression gives a few small speed increases...


Notes:



[#1625] Tuesday, September 20, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
amelican

Total Points: 162
Total Questions: 116
Total Answers: 108

Location: Guam
Member since Mon, May 29, 2023
1 Year ago
amelican questions
Sun, Aug 14, 22, 01:26, 2 Years ago
Mon, Apr 24, 23, 18:12, 1 Year ago
Wed, Apr 5, 23, 04:30, 1 Year ago
Thu, Sep 1, 22, 02:14, 2 Years ago
Wed, Jun 8, 22, 04:42, 2 Years ago
;