rsync prints "skipping non-regular file" for what appears to be a regular directory

rsync dry-run
rsync stats
rsync filter
rsync --update
rsync force
rsync --append
rsync rsh
rsync --bwlimit

I back up my files using rsync. Right after a sync, I ran it expecting to see nothing, but instead it looked like it was skipping directories. I've (obviously) changed names, but I believe I've still captured all the information I could. What's happening here?

$ ls -l /source/backup/myfiles
drwxr-xr-x 2 me me  4096 2010-10-03 14:00 foo
drwxr-xr-x 2 me me  4096 2011-08-03 23:49 bar
drwxr-xr-x 2 me me  4096 2011-08-18 18:58 baz

$ ls -l /destination/backup/myfiles
drwxr-xr-x 2 me me  4096 2010-10-03 14:00 foo
drwxr-xr-x 2 me me  4096 2011-08-03 23:49 bar
drwxr-xr-x 2 me me  4096 2011-08-18 18:58 baz

$ file /source/backup/myfiles/foo
/source/backup/myfiles/foo/: directory

Then I sync (expecting no changes):

$ rsync -rtvp /source/backup /destination
sending incremental file list
backup/myfiles
skipping non-regular file "backup/myfiles/foo"
skipping non-regular file "backup/myfiles/bar"

And here's the weird part:

$ echo 'hi' > /source/backup/myfiles/foo/test
$ rsync -rtvp /source/backup /destination
sending incremental file list
backup/myfiles
backup/myfiles/foo
backup/myfiles/foo/test
skipping non-regular file "backup/myfiles/foo"
skipping non-regular file "backup/myfiles/bar"

So it worked:

$ ls -l /source/backup/myfiles/foo
-rw-r--r-- 1 me me  3126091 2010-06-15 22:22 IMGP1856.JPG
-rw-r--r-- 1 me me  3473038 2010-06-15 22:30 P1010615.JPG
-rw-r--r-- 1 me me        3 2011-08-24 13:53 test

$ ls -l /destination/backup/myfiles/foo
-rw-r--r-- 1 me me  3126091 2010-06-15 22:22 IMGP1856.JPG
-rw-r--r-- 1 me me  3473038 2010-06-15 22:30 P1010615.JPG
-rw-r--r-- 1 me me        3 2011-08-24 13:53 test

but still:

$ rsync -rtvp /source/backup /destination
sending incremental file list
backup/myfiles
skipping non-regular file "backup/myfiles/foo"
skipping non-regular file "backup/myfiles/bar"

Other notes:

My actual directories "foo" and "bar" do have spaces, but no other strange characters. Other directories have spaces and have no problem. I 'stat'-ed and saw no differences between the directories that don't rsync and the ones that do.

If you need more information, just ask.

Are you absolutely sure those individual files are not symbolic links?

Rsync has a few useful flags such as -l which will "copy symlinks as symlinks". Adding -l to your command:

rsync -rtvpl /source/backup /destination

I believe symlinks are skipped by default because they can be a security risk. Check the man page or --help for more info on this:

rsync --help | grep link

To verify these are symbolic links or pro-actively to find symbolic links you can use file or find:

$ file /path/to/file
/path/to/file: symbolic link to `/path/file`
$ find /path -type l
/path/to/file

rsync - report only uploaded files, rsync with a single -v actually prints only transferred files. If you are getting the complete list every time then it probably means that the default rsync src/dest comparison algorithm, which is based on modification time + size, is not suitable for your case. Copy directories and files using the rsync file-transfer program for Linux. The command includes additional options beyond customary copy functions. One of the more useful features of rsync is that it excludes files in a systematic way. As such, it backs up files intended for archiving while avoiding everything else.

Are you absolutely sure that it's not a symbolic link directory?

try a:

file /source/backup/myfiles/foo

to make sure it's a directory

Also, it could very well be a loopback mount try

mount

and make sure that /source/backup/myfiles/foo is not listed.

rsync compare directories?, "grep delet" because each line prints : deleting ..file.. rsync -avun $SOURCE $​TARGET will give you a list of "different" files (including new files). rsync prints “skipping non-regular file” for what appears to be a regular directory

You should try the below command, most probably it will work for you:

rsync -ravz /source/backup /destination

rsync examples, means that it prints on the screen what is being copied. More Examples: rsync -​rv user01@server01.comentum.com:/home/user01/ /home/bob/user01backup/ rsync is free and open source tool. It is useful to copy local or remote file. It reduces the amount of data sent over the network by sending only the differences between the source files and the existing files in the destination.

You can try the following, it will work

rsync -rtvp /source/backup /destination

rsync prints "skipping non-regular file" for what appears to be a , Are you absolutely sure those individual files are not symbolic links? Rsync has a few useful flags such as -l which will "copy symlinks as  Backing up data using rsync command rsync is a great tool for backing up and restoring files. I'll use some example to explain on how it works. Example of the remote server and folder that needs to be backup or copied:

I personally always use this syntax in my script and works a treat to backup the intire system (skipping sys/* & proc/* nfs4/*)

sudo rsync --delete --stats  --exclude-from $EXCLUDE -rlptgoDv / $TARGET/ | tee -a $LOG

Here is my script run by root's cron daily:

#!/bin/bash
#
NFS="/nfs4"
HOSTNAME=`hostname`
TIMESTAMP=`date "+%Y%m%d_%H%M%S"`
EXCLUDE="/home/gcclinux/Backups/root-rsync.excludes"
TARGET="${NFS}/${HOSTNAME}/SYS"
LOGDIR="${NFS}/${HOSTNAME}/SYS-LOG"
CMD=`/usr/bin/stat -f -L -c %T ${NFS}`

## CHECK IF NFS IS MOUNTED...

if [[ ! $CMD == "nfs" ]];then
    echo "NFS NOT MOUNTED"
    exit 1
fi

## CHECK IF LOG DIRECTORY EXIST

if [ ! -d "$LOGDIR" ]; then
    /bin/mkdir -p $LOGDIR
fi

## CREATE LOG HEADER
LOG=$LOGDIR/"rsync_result."$TIMESTAMP".txt"

echo "-------------------------------------------------------" | tee -a $LOG
echo `date` | tee -a $LOG
echo "" | tee -a $LOG

## START RUNNING BACKUP
/usr/bin/rsync --delete --stats  --exclude-from $EXCLUDE -rlptgoDv / $TARGET/ | tee -a $LOG

Backup & Recovery: Inexpensive Backup Solutions for Open Systems, Here are a few other things to consider if you're going to use the rsync find /​backups/home.1 -type f -links 1 -print The following command prints their total disk  Rsync is widely used for backups and mirroring and as an improved copy command for everyday use. Rsync finds files that need to be transferred using a lqquick checkrq algorithm (by default) that looks for files that have changed in size or in last-modified time.

rsync, prints the rsync version number and exits. -v, --verbose. increases the amount of information given during the transfer. By default, rsync works silently. A single -v  rsync is a fast and extraordinarily versatile file copying tool. It can copy locally, to/from another host over any remote shell, or to/from a remote rsync daemon. It offers a large number of options that control every aspect of its behavior and permit very flexible specification of the set of files to be copied.

Get to Know rsync, The verbose option (v) tells rsync to print to the terminal what it's doing in greater detail. I like to use this when I'm testing an rsync command  rsync prints “skipping non-regular file” for what appears to be a regular directory

wchang22/LuminS: A fast and reliable alternative to rsync , A fast and reliable alternative to rsync for synchronizing local files written in Rust information SUBCOMMANDS: cp Multithreaded directory copy help Prints this​  We use -i (--itemize-changes) to tell rsync to print one line of output for every file that contains information about any differences between the two directories. We need -n to suppress normal behavior of rsync (which is to try to sync the two dirs by copying/deleting files). we also need -r to work recursively for all files/sub-dirs.

Comments
  • Yet another example of a poorly worded status/error message. If your code is skipping the file because it is a symlink, then why not print "skipping symlink"?
  • My guess is that rsync is older than symlinks. Maybe they just haven't bothered to add it since it is such a rare use-case. Nothing stopping you from contributing: rsync.samba.org/bugzilla.html
  • $ file /source/backup/myfiles/foo /source/backup/myfiles/foo/: directory and 'mount' shows the filesystems that /source and /destination are on, but no 'lower' than that.
  • Files are skipped anyway