I have a rsync script which connects to a remote machine and pulls a file list back to backup. It also parses a remote config file and creates a local exclude list to use when doing the backup. I wont bore you with the script details but im having a weird issue with exclude. If there are files to be excluded they are put into a file like this :- $ cat tmp/lavatest.exclude /path/to/exclude /export/home/user/test/dontgetme Now when the rsync runs i use the following options (ignore the variables):- rsync -exclude-from=/path/tmp/lavatesting.exclude -PaRzq --delete --delete-excluded --copy-unsafe-links --numeric-ids -e "${SSH}" root@${remote_get_host}:${RLIST} ${remote_get_localdir} >> ${remote_errorlog} 2>> ${remote_errorlog} The file list im trying to backup just for this e.g is /export/home/user/test/ which contains a file called 'getme' and one called 'dontgetme' I assumed the dontgetme should be excluded. I get the following in the log i create - Starting get of [/etc/inet/hosts] rsync: -exclude-from=/path/tmp/lavatesting.exclude: unknown option rsync error: syntax or usage error (code 1) at main.c(994) Starting get of [/export/home/user/test] rsync: -exclude-from=/path/tmp/lavatesting.exclude: unknown option rsync error: syntax or usage error (code 1) at main.c(994) Any ideas?
Yep. It's confirmed im an idiot. Its --exclude-from not -exclude-from. All working wonderfully now Cheers Dave Markham wrote:> I have a rsync script which connects to a remote machine and pulls a > file list back to backup. It also parses a remote config file and > creates a local exclude list to use when doing the backup. I wont bore > you with the script details but im having a weird issue with exclude. > > If there are files to be excluded they are put into a file like this :- > > $ cat tmp/lavatest.exclude > /path/to/exclude > /export/home/user/test/dontgetme > > Now when the rsync runs i use the following options (ignore the variables):- > > rsync -exclude-from=/path/tmp/lavatesting.exclude -PaRzq --delete > --delete-excluded --copy-unsafe-links --numeric-ids -e "${SSH}" > root@${remote_get_host}:${RLIST} ${remote_get_localdir} >> > ${remote_errorlog} 2>> ${remote_errorlog} > > The file list im trying to backup just for this e.g is > /export/home/user/test/ which contains a file called 'getme' and one > called 'dontgetme' > > I assumed the dontgetme should be excluded. > > I get the following in the log i create - > > Starting get of [/etc/inet/hosts] > > rsync: -exclude-from=/path/tmp/lavatesting.exclude: unknown option > rsync error: syntax or usage error (code 1) at main.c(994) > > Starting get of [/export/home/user/test] > > rsync: -exclude-from=/path/tmp/lavatesting.exclude: unknown option > rsync error: syntax or usage error (code 1) at main.c(994) > > > Any ideas? >
Apparently Analagous Threads
- Destination directory creation
- quiet option doesnt seem to work
- omit /etc/issue message when running rsync
- [CRASH] crypto: virtio: crash when modprobing tcrypt on 5.5-rc7 / next-20200122
- [CRASH] crypto: virtio: crash when modprobing tcrypt on 5.5-rc7 / next-20200122