Rsync bash script and hard link files

I am creating a bash script to backup my files using rsync.

Backups consist of one directory. I want new or changed files to be copied.

I am currently talking to rsync to backup the directory and check the files compared to the last backup.

How am i doing this

THE_TIME=`date "+%Y-%m-%dT%H:%M:%S"` rsync -aP --link-dest=/Backup/Current /usr/home/user/backup /Backup/Backup-$THE_TIME rm -f /Backup/Current ln -s /Backup/Backup-$THE_TIME /Backup/Current 

I am sure I have the syntax for this. Each backup will check the Current folder and download only as needed. He will then delete the current folder and re-create a symbolic link to the newest backup that she just made.

I get an error when running the script:

 rsync: link "/Backup/Backup-2010-08-04-12:21:15/dgs1200series_manual_310.pdf" 

=> /Backup/Current/dgs1200series_manual_310.pdf failed: operation is not supported (45)

The host operating system runs the HFS file system, which supports tight binding. I am trying to find out if something else does not support this, or if I have a problem in my code.

Thanks for any help

Edit:

I can create a hard link on my local machine. I can also create a hard link on a remote server (when logging in locally) I can NOT create a hard link on a remote server when installing via afp. Even if both files exist on the server.

I assume this is a limitation of afp.

+4
source share
3 answers

Highlight two things from the main page:

If the file is not associated, double-check its attributes. Also check if some attributes are called outside of rsync control, a mount option that compresses the root to one user or mounts a removable drive with shared access (for example, OS X "Ignore ownership of this volume").

and

Note that versions of rsync prior to 2.6.1 had an error that could prevent -link-dest from working properly for a non-superuser when -o is specified (or implies -a). You can work this error by avoiding the -o option when sending to the old rsync.

Do you have the option "ignore ownership" enabled? Which version of rsync do you have?

Also, have you tried manually creating a similar link using ln on the command line?

+1
source

Just in case, your command line is just an example: be sure to specify the link-dest directory with the name absolute ! This is what took me quite a while to figure out ...

+3
source

I do not know if this is the same problem, but I know that rsync cannot synchronize the file when the destination is a FAT32 partition and the file name has a “:” (colon) in it. [The source file system is ext3, and the destination is FAT32]

Try reconfiguring the date command so that it does not use a colon and does not notice if it matters.

eg.

 THE_TIME=`date "+%Y-%m-%dT%H_%_%S"` 
+1
source

All Articles