Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm copying a large amount of files between disks. There's approximately 16 GB of data. I'd like to see progress information, and even an estimated time of completion from the command line.

Any advice?

share|improve this question
add comment

3 Answers

up vote 7 down vote accepted

Use rsync --human-readable --progress.

For single files and block devices there's also pv. And if you genuinely need an accurate progress bar, try using tar with pv — something like this:

source=/the/source/directory
target=/the/target/directory
size=$(du -sx "$source")
cd "$source"
find . xdev -depth -not -path ./lost+found -print0 \
    | tar --create --atime-preserve=system --null --files-from=- \
          --format=posix --no-recursion --sparse \
    | pv --size ${size}k \
    | { cd "$target"; \
        tar --extract --overwrite --preserve-permissions --sparse; }

Be warned, however, that GNU tar does not yet support ACLs or extended attributes, so if you are copying filesystems mounted with the "acl" or "xattrs" options, you need to use rsync (with the "--acls" and "--xattrs" options). Personally, I use:

rsync --archive --inplace --hard-links --acls --xattrs --devices --specials \
    --one-file-system --8-bit-output --human-readable --progress /source /target

Also look into whether you want to use the --delete and/or --numeric-ids options.

share|improve this answer
    
Was posting that. However, be aware that it doesn't provide a reliable "progress over total copy time". However, rsync brings many benefits to this kind of stuff. –  alex Jun 9 '10 at 19:21
add comment

instead of dd i would suggest 'pv': alt text

% tar -cf - INPUT | pv -rbe -s SIZE | tar -xf - -C DEST 
share|improve this answer
add comment

Have you tried rsync -P? If you're using dd, e.g. tar -cf - src | dd | (cd dest; tar -xf -) you should be able to use Ctrl-T (SIGINFO) to see your progress.

share|improve this answer
    
Linux doesn't even have SIGINFO. –  Teddy Jun 9 '10 at 19:41
    
When copying with dd I send SIGUSR1 to dd instead to cause it to print the statistics. A simple killall -USR1 dd will do the job. (Which works on Linux, even if, as Teddy points out, Ctrl+T doesn’t work.) –  Jeremy Visser Jun 10 '10 at 13:24
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.