Thursday 1 September 2011

backing up - or not.

ive got a good system running for backing up windows machines .
I thought Id sort out the backing up of my  linux machine as well.
So i thought id do the same thing
  • create a shared folder on the remote system
  • make it accessible to the computer I want to back up . 
  • run rsnapshot and Im done 
But Im not done  .Both systems run linux , so it would be a nfs share.


on the server
root@server:/home/backup/mars/hourly.0/mars# ls -la /home/backup/ | grep ma
drwxrwxrwx  4 mars    users     4096 2011-09-01 14:27 mar
root@server:/home/backup/mars/hourly.0/mars#
 
 on the client
 mar@mar-desktop:/mnt$ mount | grep nfs
 192.168.2.20:/home/backup/mar on /mnt/marbackup type nfs 
 (rw,vers=4,addr=192.168.2.20,clientaddr=192.168.2.3)
 and i get this
 
 mars@mars-desktop:/mnt$ sudo rsnapshot  -c /etc/rsnapshot.conf  hourly
 require Lchown
 Lchown module loaded successfully
 Setting locale to POSIX "C"
 echo 6806 > /var/run/rsnapshot.pid
 mkdir -m 0755 -p /mnt/marsbackup/hourly.0/
 /usr/bin/rsync -avx --delete --numeric-ids --relative --delete-excluded \
     --temp-dir=/tmp --exclude=*iso --exclude=Dropbox/* --exclude=Ubuntu* \
     --exclude=.* --exclude=Downloads/* /home/mars \
     /mnt/marsbackup/hourly.0/mars/
 sending incremental file list
 created directory /mnt/marbackup/hourly.0/mars
 /home/
 rsync: chown "/mnt/marbackup/hourly.0/mar/home" failed: Remote I/O 
 error (121)
 /home/mars/
 rsync: chown "/mnt/marbackup/hourly.0/mar/home/mars" failed: Remote 
 I/O error (121)
 /home/mars/A4L Flyer (2up, 2x A5).ott
 /home/mars/Agenda_Committee Net Meeting_17_July_2011.pdf
 /home/mars/CTX.DAT
 
 etc
 on the server its this
 root@server:/home/backup/mar/hourly.0/mars/home/mar# ls -la
 total 1956
 drwx------ 21 nobody nogroup   4096 2011-09-01 14:38 .
 drwx------  3 nobody nogroup   4096 2011-06-04 15:27 ..
 -rw-------  1 nobody nogroup 113146 2011-08-26 13:40 a4flyer.jpg
 -rw-------  1 nobody nogroup   9955 2011-08-26 12:16 A4L Flyer (2up, 2x  A5).ott
 -rw-------  1 nobody nogroup  71243 2011-07-17 20:10 Agenda_Committee 
 Net Meeting_17_July_2011.pdf
 
 I can access the backed up stuff from the server , as root .
 
 but when i come to run the backup again
 it fails
 
 mars@mars-desktop:/mnt$ sudo rsnapshot  -c /etc/rsnapshot.conf  hourly
 require Lchown
 Lchown module loaded successfully
 Setting locale to POSIX "C"
 echo 6918 > /var/run/rsnapshot.pid
 native_cp_al("/mnt/marbackup/hourly.0", "/mnt/marbackup/hourly.1")
 mkdir("/mnt/marbackup/hourly.1", 0755)
 safe_chown(4294967294, 4294967294, "/mnt/marbackup/hourly.1")
 ----------------------------------------------------------------------------
 rsnapshot encountered an error! The program was invoked with these options:
 /usr/bin/rsnapshot -c /etc/rsnapshot.conf hourly
 ----------------------------------------------------------------------------
 ERROR: Warning! Could not safe_chown(4294967294, 4294967294, 
 "/mnt/marbackup/hourly.1");
 ERROR: Error! cp_al("/mnt/marbackup/hourly.0/", 
 "/mnt/marbackup/hourly.1/")
 /usr/bin/logger -i -p user.err -t rsnapshot /usr/bin/rsnapshot -c \
     /etc/rsnapshot.conf hourly: ERROR: Error! \
     cp_al("/mnt/marbackup/hourly.0/", "/mnt/marbackup/hourly.1/")
 rm -f /var/run/rsnapshot.pid
 mars@mars-desktop:/mnt$
the problem is the root_squash option in nfs . The defautl is root_squash - ie  stuff transferred across is owned by nobody, rather thatn user that can do stuff. 
 
So i changed the mount options to 
rw,no_root_squash, and added the same user (mar) to the server . 
But still not fixed.I think the UIDs have to be the same as well 
 
And the ssh option in rsnapshot looks like its a pull backup option rather than push. 
Hmmm . I'l have to have think about this 
 

 







No comments:

Post a Comment