Difference between revisions of "Network backup"

From FreekiWiki
Jump to navigation Jump to search
(updated ip address... should probably get cactus 2 (or whatever it'll be called) set up properly and in dns)
(updated ip address... should probably get cactus 2 (or whatever it'll be called) set up properly and in dns)
Line 2: Line 2:
  
 
To backup a persons home folder(s) over the network using scp (as root)
 
To backup a persons home folder(s) over the network using scp (as root)
  scp -r /home/ tsbackup@192.168.2.143:/var/tsbackup/[date - persons name]
+
  scp -r /home/ tsbackup@192.168.2.101:/var/tsbackup/[date - persons name]
 
replace [date - persons name] with the appropriate information
 
replace [date - persons name] with the appropriate information
  

Revision as of 15:04, 27 October 2010

You will need to be on a wired connection for this to work

To backup a persons home folder(s) over the network using scp (as root)

scp -r /home/ tsbackup@192.168.2.101:/var/tsbackup/[date - persons name]

replace [date - persons name] with the appropriate information

To restore do the opposite (as root)

scp -r tsbackup@192.168.2.101:/var/tsbackup/[date-name] /home/ 

If you have reinstalled and the user had accounts other then oem you will still need to recreate those user accounts:

adduser [username]

You might also need to apply proper permissions

find /home/username/ -type f -exec chgrp -r username {} \; 
find /home/username/ -type f -exec chown -r username {} \; 
find /home/username/ -type f -exec chmod 644 {} \;
find /home/username/ -type d -exec chmod 754 {} \;

or for move private users

find /home/username/ -type f -exec chgrp -r username {} \; 
find /home/username/ -type f -exec chown -r username {} \;  
find ./ -type f -exec chmod 640 {} \;
find ./ -type d -exec chmod 750 {} \;

When you are finished with a backup and sure that all the data is properly transfered remove it from Cactus2

rm -r /var/tsbackup/[date-name]