Rsync times

Status
Not open for further replies.

tom__w

Explorer
Joined
Mar 26, 2013
Messages
87
From a newer than newbie, how can I see how long it took for a scheduled RSync job to complete?
 

fracai

Guru
Joined
Aug 22, 2012
Messages
1,212
I don't think this is logged anywhere. Instead, you could create your own rsync task that is run as a cronjob. When complete, rsync outputs the total bytes transferred and how long it took. Cron would email this data if you have that configured.
 

tom__w

Explorer
Joined
Mar 26, 2013
Messages
87
I think I want to use a command line like the following, pushing data from my primary FreeNAS machine to my backup FreeNAS:

rsync -avn --delete --log-file=/mnt/zfs1/rsync.log /mnt/zfs1 192.168.254.9::RSync_Dell

Where:
n = I just want to see what happens first. Will remove on success.
192.168.254.9::RSync_Dell = Remote rsync IP address and module name

Does this look right to you. Being such a newbee, I am afraid to run it without some feedback.

Tom
 

fracai

Guru
Joined
Aug 22, 2012
Messages
1,212
I'm not familiar with using modules, but the rest looks fine. I usually also use '--partial' to resume large files if the transfer is interrupted, rather than starting over, but that's up to you.

Actually, using '--log-file' will write details to that file instead of stdout and you won't get anything by email. You can set the '--log-format=""' and then pipe through "grep -v '^$'" to remove the blank lines, but I think you'd be more interested in seeing '--stats'. You'll get to see info on how much was considered, transferred, how long it took, etc. Plus, you won't need to supply '-v' if you don't care about seeing every file that is transferred.

I think your command is going to be:
Code:
rsync -an --delete --partial --stats /mnt/zfs1 192.168.254.9::RSync_Dell

And then remove the 'n' when you're ready to let it run.

If you really do want to keep the log file, you can still use it; the '--stats' info will still be written to stdout.
 

JaimieV

Guru
Joined
Oct 12, 2012
Messages
742
Prepend 'time ' to your command line and you'll get an timing-appropriate summary once it's completed, so you can skip the --log-file or --stats bits unless you'd like to see them.

Otherwise good. The -n will affect the time taken, note.
 

fracai

Guru
Joined
Aug 22, 2012
Messages
1,212
Gah, 'time' is indeed a dead simple way to get what you're looking for.
 

tom__w

Explorer
Joined
Mar 26, 2013
Messages
87
when I add "--time" I get a syntax error?

- - - Updated - - -

never mind
 

JaimieV

Guru
Joined
Oct 12, 2012
Messages
742
:) For benefit of later confused people, the full thing is

Code:
time rsync -an --delete --partial /mnt/zfs1 192.168.254.9::RSync_Dell
 

tom__w

Explorer
Joined
Mar 26, 2013
Messages
87
Hey guys ... I am looking at an existing job that started at 9:00 this morning. Not a cron rsync but a scheduled rsync task.

It looks as though it has hung for whatever reason. Is there a way to cancel the task? (i.e. it is not a cron job nor was it run from the command line)
 

fracai

Guru
Joined
Aug 22, 2012
Messages
1,212
I'd think you'd be able to use 'ps' to find the PID and then just use 'kill' to end the job. Presumably you already used 'ps' or something similar to identify that it was still running. Does 'top' show that it's using resources? Are you sure it's hung and not just transferring a lot of data? You should be able to inspect that using the web gui.
 

tom__w

Explorer
Joined
Mar 26, 2013
Messages
87
I am looking at the remote machine and the files have not changed in size or time for 2+ hours

- - - Updated - - -

images attached....
 

tom__w

Explorer
Joined
Mar 26, 2013
Messages
87
Source machine:
PID USERNAME THR PRI NICE SIZE RES STATE C TIME WCPU COMMAND
28046 root 1 119 0 536M 531M CPU1 1 295:38 100.00% rsync

Remote machine has two processes running:
PID USERNAME THR PRI NICE SIZE RES STATE C TIME WCPU COMMAND
49924 root 1 44 0 7728K 2228K select 0 86:25 0.00% rsync
49925 root 1 44 0 7728K 2332K select 0 12:04 0.00% rsync
 
Status
Not open for further replies.
Top