Rsync Special Files – Understanding Rsync’s Relationship with Special Files

devicesrsync

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

Best Answer

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.

Related Question