I've used rsync for years to keep a backup copy of my /home/User1 (Client1) on my Server1 (in a folder /mnt/Server1/Backup). These are not production machines. This folder is mounted on Client1 with NFS at boot in the /mnt/Server1/Backup folder (so /mnt/Server1/Backup on Server1 is mounted with NFS on Client1 in /mnt/Server1/Backup).
On both machines, /mnt/Server1/Backup belongs to User1/Group1 with permissions 770.
I installed rsnapshot on Client1 with the intention of getting it to backup on a daily basis in the folder (/mnt/Server1/Backup). User1 already exists on Client1 and Server1 and can SSH with keys and no password.
I've added the following to /etc/rsnapshot.conf:
##############################
### SNAPSHOT ROOT DIRECTORY ##
##############################
snapshot_root /mnt/Server1/Backup/
##############################
### BACKUP POINTS/ SCRIPTS ###
##############################
# LOCALHOST
backup /home/User1 Client/
When I launch "rsnapshot configtest" I get "Syntax OK".
When I run "rsnapshot -t alpha" I get the following:
[dom ott 14, 01:12 ][user1@client1:~]rsnapshot -t alpha
echo 23033 > /var/run/rsnapshot.pid
mkdir -m 0755 -p /mnt/Server1/Backup/rsnapshot/alpha.0/
/usr/bin/rsync -a --delete --numeric-ids --relative --delete-excluded \
/home/Client1/ /mnt/Server1/Backup/rsnapshot/alpha.0/Client1/
touch /mnt/Server1/Backup/rsnapshot/alpha.0/
[dom ott 14, 01:12 ][user1@client1:~]
It seems like all is fine. However, when I launch without option t I get the following:
[dom ott 14, 01:12 ][user1@client1:~]rsnapshot alpha
----------------------------------------------------------------------------
rsnapshot encountered an error! The program was invoked with these options:
/usr/bin/rsnapshot alpha
----------------------------------------------------------------------------
ERROR: Could not write lockfile /var/run/rsnapshot.pid: Permission denied
rsnapshot is complaining because there are no sufficient permissions for it to write the PID on main filesystem of Client1.
I don't think I should be using sudo otherwise how do I create a cronjob without asking of password?
I could use an ad hoc debian user "backup" ... but how do I resolve the PID problem?