Hello everyone. I have a question about using the include/exclude function for rsync. What I am trying to do is backup specific directories and their corresponding data, while at the same time, excluding other directories. Specifically, I have a backup server with the follow setup: /backupstorage/D/...all the directories are here...there are roughly 18 directories. So what I was trying to do was create a file that I can point to specify what directories I want backed up. Here is what I was attempting: rsync -avn --include-file=/home/rsyncfile /backupstorage/D/ /home/rsyncbak It is a dry run of course. However, it still wants to backup everything in the /backupstorage/D/. Here is a quick snip of what is in my rsyncfile: /backupstorage/D/1999 TaxReturns/ /backupstorage/D/Appraisals/ /backupstorage/D/CLOSED00/ /backupstorage/D/CLOSED01/ /backupstorage/CLOSED02/ /backupstorage/D/CLOSED97/ /backupstorage/D/CLOSED98/ /backupstorage/D/CLOSED99/ Im guessing that im not specifying correctly in the file. Anyone have any input on what im doing wrong? Thank you. Jason
On Thu, Jun 26, 2003 at 12:07:42PM -0700, Jason Williams wrote:> rsync -avn --include-file=/home/rsyncfile /backupstorage/D/ /home/rsyncbakThe most common failing is people not specifying the excludes relative to the root of the transfer (it's not relative to the root of the file system). Thus, this include:> /backupstorage/D/CLOSED00/says to transfer directory /backupstorage/D/backupstorage/D/CLOSED00. You probably meant to say this: /CLOSED00/ Also, don't forget to end the list with: - /* So that no other dirs/files get sent but the ones you listed. ..wayne..
Jason Williams wrote:> Hello everyone. > > I have a question about using the include/exclude function for rsync. > What I am trying to do is backup specific directories and their > corresponding data, while at the same time, excluding other directories. > > Specifically, I have a backup server with the follow setup: > > /backupstorage/D/...all the directories are here...there are roughly 18 > directories. > > So what I was trying to do was create a file that I can point to specify > what directories I want backed up. > > Here is what I was attempting: > > rsync -avn --include-file=/home/rsyncfile /backupstorage/D/ /home/rsyncbak > > It is a dry run of course. However, it still wants to backup everything in > the /backupstorage/D/. > > Here is a quick snip of what is in my rsyncfile: > > /backupstorage/D/1999 TaxReturns/ > /backupstorage/D/Appraisals/ > /backupstorage/D/CLOSED00/ > /backupstorage/D/CLOSED01/ > /backupstorage/CLOSED02/ > /backupstorage/D/CLOSED97/ > /backupstorage/D/CLOSED98/ > /backupstorage/D/CLOSED99/ > > Im guessing that im not specifying correctly in the file. > > Anyone have any input on what im doing wrong?The default is include. Since you haven't excluded anything, everything is either included-explicitly or included-by-default. Max.