發表文章

目前顯示的是有「rsync」標籤的文章

Backup IBM Qradar 7.4.2 file to IBM AIX 7.2

# from QRadar EP terminal ssh-keygen -t rsa ssh-copy-id user@AIX. # not work ## then we try to use expect program method # touch scp.exp and input content of follows  #!/usr/bin/expect set filename [lindex $argv 0] spawn scp  -r $filename user@AIX:~ expect {  "(yes/no)?" { send "yes\n"}  "*password:" { send "yourpass\n";exp_continue} } interact expect eof #touch backup.sh for filename in $(ls *) do ./scp.exp $filename done

Exclude multiple files or folder in rsync command

 1.  rsync command for multi exclude files or folder $ rsync -arv --exclude={'course','download','tmpfile.txt'} /var/www/  /backup/www one folder $ rsync -arv --exclude 'download' /var/www/ /backup/www one file $ rsync -arv --exclude 'tmpfile.txt' /var/www/ /backup/www wildcard or patterns $ rsync -arv --exclude '*.iso' /var/www/ /backup/www -a: -rlptgoD -v: verbose -r: --recursive references https://linuxhint.com/exclude-directory-rsync/ https://phoenixnap.com/kb/rsync-exclude-files-and-directories        

Rsync to updated backup between folder A and B on CentOS Linux

 1. If source is folder A, and destination is folder B, rsync will not produce new folder A in folder B, only backup files under folder A. > rsync -rulptgo /A/ /B -r  recursive : recurse into directories -u  update : skip files that are newer on the receiver -l  links : copy simlinks as symlinks -p perms : preserve permission -t times : preserve modification times -g group: preserve group -o owner: preserve owner -v verbose : increase verbosity - a  stands for  -rlptgoD