Closed lyenliang closed 4 years ago
As per manual:) Usage:
$(basename $0) [OPTION]... <[USER@HOST:]SOURCE> <[USER@HOST:]DESTINATION> [exclude-pattern-file]
so in your case run
./rsync_tmbackup.sh -i ~/.ssh/my-key.pem -p 22 /home/ec2-user/rsync_folder ec2-user@123.123.123.123:/home/ec2-user /home/ec2-user/rsync-time-backup/exclude_list.txt
@kapitainsky Thank you. Now it works.
if you would like directly specify rsync --exclude-from
or any other rsync parameter you have to use --rsync-set-flags
e.g.
./rsync_tmbackup.sh --rsync-set-flags="--exclude-from=exclude_list.txt" -i ~/.ssh/my-key.pem -p 22 /home/ec2-user/rsync_folder ec2-user@123.123.123.123:/home/ec2-user
I tried to run
rsync_tmbackup.sh
with--exclude-from
option. But it always gives mersync: failed to open exclude file --exclude-from=exclude_list.txt: No such file or directory (2)
errorHere's my folder structure:
Here are the things I've tried:
Add full path
--exclude-from=/home/ec2-user/rsync-time-backup/exclude_list.txt
to the end of the command.Add relative path
--exclude-from=exclude_list.txt
to the end of the command, and putexclude_list.txt
to the folder wherersync_tmbackup.sh
is located in.Anyone knows how to use
--exclude-from
?