|
Search Forums:
|
|||||||
| Forums | Register | Forum Rules | Linux and Unix Links | Man Pages | Albums | FAQ | Users | Calendar | Search | Today's Posts | Mark Forums Read |
| Linux RedHat, Ubuntu, SUSE, Fedora, Debian, Mandriva, Slackware, Gentoo linux, PCLinuxOS. All Linux questions here! |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
||||
|
||||
|
Viewing the progress of diff?
I recently made an rsync backup of a relatively large directory with a lot of subdirectories (around 30GB size in total).
Now I'm trying to see if everything went well and every file is where it should be, so I'm using the diff command (to be more specific, diff -rq /dir_source /dir_dest), but I have no idea when it will finish. So does anyone know of any way to view the progress of this process, or otherwise any other utility which has this progress function? I'm using GNU diffutils 3.0 Thanks in advance. |
| Sponsored Links | |
|
|
|
#2
|
|||
|
|||
|
You have to instrument your code as there is no progress bar or something that gives a running count of lines processed. And for what you are doing I would just use a checksum. All you want to know is: did it work okay? Not where some things differ in files, because you will just recopy to fix it. And. Unless you got errors during copy, the probability of failure is really very low, except if you were ftp-ing from windows to Unix. You were not doing that. Code:
#!/bin/bash
cd /path/to/oldfiles
export DEST=/path/to/newfiles
cnt=0
for fname in *
do
old=$(cksum $fname )
old=${old%% *}
new=$(cksum $DEST/${fname})
new=${new%% *}
cnt=$(( $cnt + 1 ))
[ $(( $cnt % 5 )) -eq 0 ] && echo "$cnt files processed"
[ "$old" = "$new" ] && continue
echo "failure on file $fname"
done |
| Sponsored Links | ||
|
|
|
#3
|
|||
|
|||
|
not sure if pv would work, but it might be worth a shot.
|
| Sponsored Links | ||
|
|
![]() |
| Tags |
| comparing directories, diff, progress |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| serach diff filename in diff location using shell scripting | Lucky123 | Shell Programming and Scripting | 1 | 11-25-2011 02:44 AM |
| .procmailrc and uudeview (put attachments from diff senders to diff folders) | optik77 | Shell Programming and Scripting | 1 | 03-27-2011 06:57 AM |
| Simulate SVN diff using plain diff | ackbarr | Shell Programming and Scripting | 3 | 02-07-2009 12:01 PM |
| how to have a cp progress bar? | wrapster | UNIX for Advanced & Expert Users | 1 | 05-21-2008 02:56 AM |
| diff 2 files; output diff's to 3rd file | blt123 | Shell Programming and Scripting | 2 | 05-28-2002 11:29 AM |
|
|