I'm using a backup script on my server that uses ditto and I keep getting the following error:

ditto: /Volumes/BKP/Daily_bkp.051114/VM Share/Machine/Backups/backup_copies.cmd: Invalid argument

This is my code

/usr/bin/ditto -V --rsrc "$VMSHARE"  "$DLY_BKP/VM Share" > $DLOG 2> $TMPLOG

I'm using double quotes to deal with the spaces in the directory name and this file is the only one ditto is having an issue with. I checked the backup and it actually backed up the file no problem, so I'm stumped as to why I keep getting this error. The file doesn't ever change and I've made sure nothing is using it at the time of the backup.

Any help will be appreciated. Thanks.


I solved it, the file in question had extended metadata on it and that is what caused the problem. I attempted using the --norsrc and --noextattr flags, but this didn't work. I removed the extended metadata and it is now working without any errors. I don't know if there is a better approach, but to get rid of the metadata I did

cat backup_copies.cmd > tmp
rm backup_copies.cmd
mv tmp backup_copies.cmd
  • Easier way to do it xattr -c file
    – nickg
    Aug 9 '14 at 17:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .