Debugging safepoint

If you are comfortable using SSH and running basic unix commands, (cd, vi, cat, tail, grep, etc.), then my recent experience may help you out. Naturally, if anything goes wrong, I am not responsible. Back up anything before changing and seriously, if you have never used Unix on the command line, just ignore this post.

/etc/cron.d/WDSAFE is the crontab for the safepoint job. This is the scheduled job (or jobs) that kick off your backups.

/usr/local/NSPT/WDSafe contains the executable script (safeptExec.pl) and libraries (in lib) that run the job. The script has a debug option, which you could add to your cron entry, but it doesn’t look like it logs a lot.

If you check out the key library CopyHandler.pm, you’ll notice that the core of the operation is based on rsync:
rsync -rtDviH --delete --progress from to etc…

/etc/mtab is your mount table - this has a list of drives to mount at startup. In it you may see an entry like this for a drive you are using to backup to:
//IP_ADDRESS/SHARE_NAME /media/WDSAFE/MOUNT_TARGET cifs rw 0 0

The second path is where you can physically access the remotely mounted drive. If you head over there, you can list the contents of the SHARE_NAME. You should see everything that has been safepointed before.

Finally, your safepoint config files are held in /DataVolume/cache/WDPROT/WDSAFE. Under safepts, you will find a file with MOUNT_TARGET as the name and you can check the config here (IP_ADDRESS, SHARE_NAME, etc.)

Anyway, if you are struggling with failed safepoint backups, you can just try running an rsynch in verbose mode to see where it trips up. Unbelievably, I had a number of music files with bad names. They had an apostrophe in them, which was not windows compliant. How I ever got them on my PC, I will never know, because if I tried to change the name and cancelled, Windows woudn’t allow it. Weird. Anyway, after going through this process a number of times, I got all the names fixed and it works fine. The bad charcter I found was ’, wheras windows only allows ’ and `.

rsync -rtDviH --progress “/DataVolume/shares/Public/Shared Music” “/media/WDSAFE/SHARE_NAME/”

Note the trailing slash.

Some other useful files:
/etc/nas/NSPT has the exclude file and other config files
/etc/nas has some other files you may want to check out
/var/log has a couple of safepoint and other log files that are vaguely useful
/etc/trustees.conf I made a note of this, but can’t remember why

This is interesting. How did you discover this?