Created
April 12, 2016 08:32
-
-
Save nitincoded/6f19a631d6f9fd11fad65bf067fe80f1 to your computer and use it in GitHub Desktop.
Setting up RSync script on NAS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#I'm Nitin the DevOps guy and these instructions are for whoever chooses to follow... | |
#Some NAS require sec=ntlm or sec=ntlmv2 as an option for it to mount | |
#Get catty with /proc/filesystem to check if cifs has been loaded after first use, them dmesg | tail to look for any other errors | |
#sudo mount -t cifs -o username=Administrator,password=Password123$ //192.168.1.53/e$ /mnt/53e/ | |
#Take a stab at auto-loading with the following in /etc/fstab and mount -a | |
#Add the sec option if needed | |
#//192.168.1.53/e$ /mnt/53e cifs username=Administrator,password=Password123$ 0 0 | |
#Test on command line | |
rsync -rv /mnt/53e/Backup/BARCODE_EAN/ /volume1/Backup/ScannerDBs/PULLBARCODE_EAN | |
#And finally get this into /etc/crontab to schedule it | |
#0 * * * * root rsync -rv /mnt/53e/Backup/BARCODE_EAN/ /volume1/Backup/ScannerDBs/PULLBARCODE_EAN | |
#When the time comes, "ps aux" it |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Use --whole-file to reduce the CPU usage; this will get rsync to copy the entire file instead of a diff of the file.
The default behavior of rsync is to perform a whole file copy unless the copy has to occur over the network, in which case it attempts to copy diffs of the files instead.