Cp script like rsync


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Cp script like rsync
# 1  
Old 11-26-2012
Cp script like rsync

Hi Folks,

I have a NAS running busybox with a ARM processor.

Several PC's backup full weekly and several daily incrementals to the NAS.

The NAS has two USB attached disks, which are swapped off site weekly.

The problem is the built in rsync only transfers at 2Mb/s to the external USB and takes about 6 hours per PC and often fails to complete.

I tried updating the built in rsync, and ran it from the command like myself with various options (-W and no-checksum) but they didnt make it any faster. I think the CPU is the bottle neck.

I am thinking of a copy script after the weekly full backup of Friday night.

The logic would be something like:

1. Delete all files older than 2 weeks from /share/external/sdu/backups
2. Copy all files from /share/backups to /share/external/sdu/backups
3. Some sort of basic verification?

The other thing that sucks is with busybox nas I dont have the cp -n option, so I cant tell it to skip existing files...grrrrrr, else I would run it nightly and just copy files that dont already exist.

I have been using find -mtime +14 to delete all files older than 2 weeks, but again their may be a better way?

Cheers

-Al
# 2  
Old 11-26-2012
What version is the USB connection? That affects speed bigtime. We have garmin basecamp running from a small NAS and it takes 1.5+ hours to move 2GB of map data out over USB to a single hand held meter.

I doubt that it is your cpu. If you can get drivers, consider upgrading the USB.

Your find command to delete files is a very standard thing to do.

Regarding rsync - if it takes a long time to do the same backup where there are lots of identical untouched files in the archiove and the source, then it is an rsync parameter problem. By default rsync uses filetimes.

To preserve filetimes in your rsync:

Do this
Code:
rsync -avp  location1 location2

So when location1 files have the same timestamp as on location2, they are skipped over.
Also, do not use -bwlimit, it throttles throughput.

Can you please post your rsync command?
# 3  
Old 11-26-2012
Oh - forgot to answer your question - cp -n is just a noclobber, you want a "newer" comparison
This is general I do not how your system sees the remote filesystems
Code:
remotedir=/someplace/
find ./somemountpoint -type f |
while read fname
do
      if [[ ! -f  ${remotedir}${fname}  ||  $fname  -nt ${remotedir}${fname} ]] ; then
        cp -p  $fname  ${remotedir}${fname}
      fi
done

However I still think either USB or rsync setup are the real problems here. Or both....

Last edited by jim mcnamara; 11-26-2012 at 07:54 PM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Rsync Error: rsync: link_stat failed: No such file or directory (2)

I wish to copy all the files & folder under /web/Transfer_Files/data/ on mymac1 (Linux) to remote server mybank.intra.com (Solaris 10) /tmp/ location I am using Ansible tool synchronize module which triggers the unix rsync command as below:rsync --delay-updates -F --compress --archive --rsh=ssh... (2 Replies)
Discussion started by: mohtashims
2 Replies

2. Shell Programming and Scripting

Help with rsync file restore script

Hello Friends, I am trying to create an rsync file restore script. I will post want I have below and explain the problem I am having. #!/bin/bash # # Partial Rsync File Restore Script # # clear echo # Shell loads into /raid0/data/backup/bin/ cd .. # I cd to the backup... (1 Reply)
Discussion started by: jdavis_33
1 Replies

3. Shell Programming and Scripting

Help with rsync script

Good day all, I need your help in editing a rsync script that I am trying to write and using ksh shell. I want to add multiple patterns --include and --exclude options with variable inputs called SID. I have created two files and named them N1 and N2 and created subfiles in each one In... (4 Replies)
Discussion started by: Noura-83
4 Replies

4. Shell Programming and Scripting

Help with rsync script

Good day all, I need your help in editing a rsync script that I am trying to write and using ksh shell. I want to add multiple patterns --include and --exclude options with variable inputs called SID. I have created two files and named them N1 and N2 and created subfiles in each one In N1... (1 Reply)
Discussion started by: Noura-83
1 Replies

5. UNIX for Advanced & Expert Users

Rsync Script Modification

Hi I have a rsync that runs from a remote location to our central data store. The sync generates a log locally not in the central location. I would like to modify the rsync to add the following The log, instead of filing locally it gets sent to a area on the central data store once the syncs... (0 Replies)
Discussion started by: treds
0 Replies

6. Shell Programming and Scripting

Help with changing rsync script

#/bin/bash #set -vx DST_SRV=<destination_hostname> MDATE=`date +%Y%m%d%H%M` SRC_CONTENT="/home/prad/sourcecontent/" DST_CONTENT="/tmp/prad/destinationfolder/" DST_LOG="/tmp/prad/STATS" CURRENT_LOG="/home/prad/STATS/rsync-current.log" EMAIL="/home/prad/EMAIL/email.log"... (3 Replies)
Discussion started by: pnara2
3 Replies

7. Shell Programming and Scripting

rsync script for synchronisation and backup

hello, i need to modified my synch/back scripts.... i want that this script only syncro folders in destinationfolder. f.e. when in destination are two folders 1) admin 2) users but in SOURCE are three: 1) admin 2) users 3) antivirus the script should only increnmential sync the... (0 Replies)
Discussion started by: onkeldave
0 Replies

8. Shell Programming and Scripting

rsync - storing password in script

Hello, I wish to store the password in an rsync script so that when prompted it just enters the password. I know I can set up passwordless logins, but I have never been able to do this on this particular server so I am resorting to storing the password in the script: rsync -avz -e ssh... (4 Replies)
Discussion started by: stuaz
4 Replies

9. Shell Programming and Scripting

rsync script ...

Hi all, I am a newbie in unix and i want a script which should sync files between two servers like rsync. The condition is that. after rsync command is completed it should also list me how many files has been changed during the rsync execution. if the rsync execution has failed , then... (2 Replies)
Discussion started by: abalakrishnan
2 Replies

10. Shell Programming and Scripting

Rsync script in cron from stepping on itself

I have the following rsync script that I use for syncing MySQL files from one server to another. I run the script at 20 minutes past every second hour in cron. I want to make sure that the script completes in it's entirety before it is set to kick off again. For example, when the script starts at... (3 Replies)
Discussion started by: sunsysadm2003
3 Replies
Login or Register to Ask a Question