5

I'm trying to transfer some existing backups from one system to another. The older backup system seems to have managed to back up special files like /dev/hda, /dev/tty0, and /dev/null which look like they were created as some part of an OS build process.

So I tried to rsync them to the new machine but I keep getting a tonne of messages like:

skipping non-regular file "machineX/latest/home/machineX/build/image/rh62/dev/agpgart"

The command I was using was:

rsync -avz /oldbackups/machineX/ newbackups:~/machineX/

AFAIK:

-a (archive) is supposed to mean -rlptgoD

-D is supposed to mean --specials --devices

I checked the files:

$ ls -la machineX/latest/home/machineX/build/image/rh62/dev/agpgart 
crw-rw-r-- 1 500 500 10, 175 Feb  4  2000 machineX/latest/home/machineX/build/image/rh62/dev/agpgart
$ file machineX/latest/home/machineX/build/image/rh62/dev/agpgart
machineX/latest/home/machineX/build/image/rh62/dev/agpgart: character special

So these are special files that should be covered by the --special switch, no?

Why is it still skipping these files?


For reference I'm using rsync with these details:

$ rsync --version
rsync  version 3.0.9  protocol version 30
Copyright (C) 1996-2011 by Andrew Tridgell, Wayne Davison, and others.
Web site: http://rsync.samba.org/
Capabilities:
    64-bit files, 64-bit inums, 32-bit timestamps, 64-bit long ints,
    socketpairs, hardlinks, symlinks, IPv6, batchfiles, inplace,
    append, ACLs, xattrs, iconv, symtimes
6

It is not --special that "should" sync the devices, it is the --devices indirect switch. For that the man page says:

--devices
       This option causes rsync to transfer character and block  device
       files  to  the  remote  system  to recreate these devices.  This
       option has no effect if the receiving rsync is not  run  as  the
       super-user (see also the --super and --fake-super options).

and you don't seem to be logging in as root on the remote system, which makes the option have no effect.

  • Spot on. --super was what I was after. It would be nicer if the error message was something like "skipping due to remote permissions" or some such. – tudor Jun 19 '15 at 5:54
  • @tudor That it doesn't work makes sense, but I agree that the reason given is a too generic. Maybe you found a summer-holiday project (or winter, depending on your hemisphere) to provide a patch to the project ;-) . – Anthon Jun 19 '15 at 6:03
  • It seems that the one condition is that it's not a regular file. "if (!IS_REG(file->mode))" github.com/AndyA/rsync/blob/… The previous section checks for amroot, so does that mean every error from that clause on should be "...and you're not root on the remote side."? :-p – tudor Jun 19 '15 at 6:16
  • @tudor I am not 100% sure you should just replace, but just testing it once more there and adding " (and your not root)" to the message if you are not would be a informative and unlikely to break anything. The original repo is on the samba.org site BTW. – Anthon Jun 19 '15 at 6:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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