bmsjeff
asked on
Backup plan for Ubuntu server
Running 8.04.1
Looking for a good routine/script to backup data to a Buffalo External USB drive. I can access it via IP or FTP, there might be other options also.
Looking for a good routine/script to backup data to a Buffalo External USB drive. I can access it via IP or FTP, there might be other options also.
Did you mount the USB directly to the computer?
> I can access it via IP or FTP
What do you mean via IP? You mean you can ssh login via IP?
> routine/script to backup data to a Buffalo External USB drive.
Where is this external USB drive connected to?
Directly connect to the Ubuntu 8.04 box?
If directly connect to the Ubuntu 8.04,
- Assume is mount as /mnt/usb
- Directory you want to backup is /path-backup-src
Folder on USB drive is /mnt/usb/backup
command:
rsync -auv /path-backup-src /mnt/usb/backup
- Setup as routine cron job
command:
crontab -e (Enter, then in vi, press "i" and type the following line)
0 1 * * * /usr/bin/rsync -auv /path-backup-src /mnt/usb/backup
(then "ESC" key and ":wq")
It will backup at 1:00AM everyday.
0 : 0 minute
1: 1 hour
* : Any day
* : Any month
* : Any week day (0:Sunday, 1: Monday...)
What do you mean via IP? You mean you can ssh login via IP?
> routine/script to backup data to a Buffalo External USB drive.
Where is this external USB drive connected to?
Directly connect to the Ubuntu 8.04 box?
If directly connect to the Ubuntu 8.04,
- Assume is mount as /mnt/usb
- Directory you want to backup is /path-backup-src
Folder on USB drive is /mnt/usb/backup
command:
rsync -auv /path-backup-src /mnt/usb/backup
- Setup as routine cron job
command:
crontab -e (Enter, then in vi, press "i" and type the following line)
0 1 * * * /usr/bin/rsync -auv /path-backup-src /mnt/usb/backup
(then "ESC" key and ":wq")
It will backup at 1:00AM everyday.
0 : 0 minute
1: 1 hour
* : Any day
* : Any month
* : Any week day (0:Sunday, 1: Monday...)
ASKER
sorry it is a NAS, not USB. it is on the network. Yes ssh via IP or FTP
> it is a NAS
Does you support NFS? If yes, can you enable it and tell us the export path?
Does you support NFS? If yes, can you enable it and tell us the export path?
If Buffalo supports NFS, then export as /share/backup with read and write permission.
On Ubuntu terminal, issue those commands:
sudo mkdir -p /nfs-share/backup
sudo mount <IP of Buffalo NAS>:/share/backup /nfs-share/backup
crontab -e (Enter, then in vi, press "i" and type the following line)
0 1 * * * /usr/bin/rsync -auv /path-backup-src /nfs-share/backup
(then "ESC" key and ":wq")
Or you setup ssh login from Ubuntu to Buffalo with ssh_key which no need to typing password.
Check this article: How-To: "Password-less" SSH
http://www.cs.wustl.edu/~mdeters/how-to/ssh/
Then
crontab -e (Enter, then in vi, press "i" and type the following line)
0 1 * * * /usr/bin/rsync -auv -e "ssh -i /path-to-ssh_key" /path-backup-src <ssh username at Buffalo>@<Buffalo IP>:/share/backup
(then "ESC" key and ":wq")
Please replace those with real ones:
/path-to-ssh_key
/path-backup-src
ssh username at Buffalo>
<Buffalo IP>
On Ubuntu terminal, issue those commands:
sudo mkdir -p /nfs-share/backup
sudo mount <IP of Buffalo NAS>:/share/backup /nfs-share/backup
crontab -e (Enter, then in vi, press "i" and type the following line)
0 1 * * * /usr/bin/rsync -auv /path-backup-src /nfs-share/backup
(then "ESC" key and ":wq")
Or you setup ssh login from Ubuntu to Buffalo with ssh_key which no need to typing password.
Check this article: How-To: "Password-less" SSH
http://www.cs.wustl.edu/~mdeters/how-to/ssh/
Then
crontab -e (Enter, then in vi, press "i" and type the following line)
0 1 * * * /usr/bin/rsync -auv -e "ssh -i /path-to-ssh_key" /path-backup-src <ssh username at Buffalo>@<Buffalo IP>:/share/backup
(then "ESC" key and ":wq")
Please replace those with real ones:
/path-to-ssh_key
/path-backup-src
ssh username at Buffalo>
<Buffalo IP>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
> sudo echo "//192.168.1.2/share /smb-share/backup smbfs auto,credentials=/root/.cr edentials, uid=1000,u mask=000,u ser 0 0/.credentials,uid=1000,um ask=000,us er 0 0" >> /etc/fstab
typo, should be
sudo echo "//192.168.1.2/share /smb-share/backup smbfs auto,credentials=/root/.cr edentials, uid=1000,u mask=000,u ser 0 0" >> /etc/fstab
typo, should be
sudo echo "//192.168.1.2/share /smb-share/backup smbfs auto,credentials=/root/.cr
ASKER
when I:
sudo apt-get install smbfs smbclient
I get:
E: Invalid operation smbfs
sudo apt-get install smbfs smbclient
I get:
E: Invalid operation smbfs
OK, no smbfs for Ubuntu
just
sudo apt-get install samba
just
sudo apt-get install samba
Or you can simply copy the important folders to the USB drive.
Did you mount the directory?