Guest JoeS Posted May 17, 2014 Posted May 17, 2014 I want to use an rsync script to do backups. I'm not sure how to use regular expressions for OPT in the script and could use some help. Quote: This is the script I am using: #!/bin/bash # Flash backup script #The source directory: SRC="/home/joe/" #The target directory: TRG="/media/linux/joe/" #The rsync options: OPT="-av --numeric-ids --delete --delete-excluded --filter=merge /home/joe/bin/scripts/flash-filter-rule.txt" #Execute the backup rsync $OPT $SRC $TRG This gave me an error: joe@crunchbang:~/bin/scripts$ bash flash-backup.txt unexpected end of filter rule: merge rsync error: syntax or usage error (code 1) at exclude.c(901) [client=3.0.9] I also tried quoting the OPT like this: OPT="-av --numeric-ids --delete --delete-excluded --filter='merge /home/joe/bin/scripts/flash-filter-rule.txt'" Unknown filter rule: `'merge' and OPT="-av --numeric-ids --delete --delete-excluded --filter=merge\ /home/joe/bin/scripts/flash-filter-rule.txt" Unknown filter rule: `merge\' How do I write this to merge in the filter rule file? Thanks Continue reading... Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.