Trying to automate backup of the following local mounts/directories to a usb drive (/mnt/usbbackup); here's what's in my include file: + /home/gravyface/www/* + /mnt/datadisk1/music/* + /mnt/datadisk2/projects/* If I run the following, nothing happens, so I checked the man and I'm not specifying a source (I thought the include-from was the source): sudo rsync --progress -avz --include-from=/home/gravyface/backup.list /mnt/usbbackup/localbackup/ I then tried the following, thinking "/" would be a common denominator in the paths in my include list: sudo rsync --progress -avz --include-from=/home/gravyface/backup.list / /mnt/usbbackup/localbackup/ ...which then starts backing up the root partition, which is not what I want (but what I asked for, presumably). Searching the web for examples of local backups returns a lot of shell scripts looping through directories, calling rsync for each iteration. Is this the route I should be taking? " --include-from" seems a lot cleaner to me. Perhaps simlinks are the answer? TIA, gravyface
On Mon 29 Jun 2009, GravyFace wrote:> > I then tried the following, thinking "/" would be a common denominator > in the paths in my include list: > sudo rsync --progress -avz --include-from=/home/gravyface/backup.list > / /mnt/usbbackup/localbackup/ > > ...which then starts backing up the root partition, which is not what > I want (but what I asked for, presumably).As the manpage says: --include-from=FILE This option is related to the --include option, ... --include=PATTERN This option is a simplified form of the --filter option that defaults to an include rule and does not allow the full rule-parsing syntax of normal filter rules. See the FILTER RULES section for detailed information on this option. The point you need to see is that everything is included by default, so specifying only include rules won't change anything. You also need to exclude the rest. The FILTER RULES section explains it pretty well, although you may need to get your head around how it works by experimenting (use -n not to actually transfer anything then). What you want to do might be easier to do as follows (not tested, I've never tried it myself :-): rsync --progress -avz --relative /home/gravyface/www/ /mnt/datadisk1/music/ /mnt/datadisk2/projects/ /mnt/usbbackup/localbackup/ Paul
On Mon, Jun 29, 2009 at 09:43:02AM -0400, GravyFace wrote:> sudo rsync --progress -avz --include-from=/home/gravyface/backup.list > / /mnt/usbbackup/localbackup/If you drop the '*'s from the lines in the file and switch to using --files-from, that should do what you were expecting. You still need to specify the "/" source because files-from files are all relative to the source. ..wayne..