delete-after receiver deletes after transfer, not before delete-delay find deletions during, delete after delete-during receiver deletes during xfer, not before delete-before receiver deletes before transfer (default) delete delete extraneous files from dest dirs remove-source-files sender removes synchronized files (non-dir) ignore-existing skip updating files that exist on receiver existing skip creating new files on receiver rsync-path=PROGRAM specify the rsync to run on remote machine e, -rsh=COMMAND specify the remote shell to use B, -block-size=SIZE force a fixed checksum block-size x, -one-file-system don’t cross filesystem boundaries W, -whole-file copy files whole (w/o delta-xfer algorithm) n, -dry-run perform a trial run with no changes made S, -sparse handle sparse files efficiently fake-super store/recover privileged attrs using xattrs super receiver attempts super-user activities O, -omit-dir-times omit directories from -times devices preserve device files (super-user only) o, -owner preserve owner (super-user only) chmod=CHMOD affect file and/or directory permissions E, -executability preserve executability K, -keep-dirlinks treat symlinked dir on receiver as dir k, -copy-dirlinks transform symlink to dir into referent dir safe-links ignore symlinks that point outside the tree copy-unsafe-links only "unsafe" symlinks are transformed L, -copy-links transform symlink into referent file/dir d, -dirs transfer directories without recursing append-verify -append w/old data in file checksum inplace update destination files in-place u, -update skip files that are newer on the receiver suffix=SUFFIX backup suffix (default ~ w/o -backup-dir) backup-dir=DIR make backups into hierarchy based in DIR b, -backup make backups (see -suffix & -backup-dir) no-implied-dirs don’t send implied dirs with -relative no-OPTION turn off an implied OPTION (e.g. a, -archive archive mode equals -rlptgoD (no -H,-A,-X) c, -checksum skip based on checksum, not mod-time & size no-motd suppress daemon-mode MOTD (see caveat) In the below example we will schedule to run the cron job at 3:30 daily.ģ0 3 * * * rsync -avzp -ignore-existing -exclude="lost+found" -exclude=".snapshot" -rsh='ssh -p 22' /target/ >/dev/null 2>&1 Options available in rsync. If you want you can schedule the rsync in cron also. Rsync -avzp -ignore-existing -exclude="lost+found" -exclude=".snapshot" -rsh='ssh -p 22' /target/ Scheduling rsync in cron In the below example we are initiating rsync from target server so we have mentioned the IP of source server.Once you ensure that ssh is working fine between the source and destination server let's move ahead. First exchange ssh keys between the source and destination server so that the servers can ssh to each other.Or, if you don't want to use NFS you can do the same with ssh. Rsync -avzp -ignore-existing -exclude="lost+found" -exclude=".snapshot" /source/ /targetNFS/ rsync and ssh Let's say we have mounted the the target filesystem as NFS on source server then the syntax will be:. One way of doing it is to mount the source or target filesystem as NFS. If you want you can also sync the filesystem which is on another server. p option is very important as it as it preserves all permissions including ACLs. Rsync -avzp -ignore-existing -exclude="lost+found" -exclude=".snapshot" /source/ /target/ Once you have installed rsync you can use it for copying data from one FS to other. You can also download it from My Oracle Support website or from here. Oracle has now started including rsync in Solaris 10 and Solaris 11. If you don't have rsync in machine you can simply install it by following commands:. Rsync is popular with Linux and included in most versions by default. The best part with rysnc is that it considers incremental data while copying and syntax is easy. Rsync is a very useful utility which can be used to take backup or copy data from one filesystem to other.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |