Link to home
Start Free TrialLog in
Avatar of bmsjeff
bmsjeffFlag for Afghanistan

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.
Avatar of farzanj
farzanj
Flag of Canada image

You can simply use tar command to make an archive and copy it to the USB directly.
Or you can simply copy the important folders to the USB drive.
Did you mount the directory?
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...)
Avatar of bmsjeff

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?
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>
ASKER CERTIFIED SOLUTION
Avatar of wesly_chen
wesly_chen
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
> sudo echo "//192.168.1.2/share  /smb-share/backup   smbfs  auto,credentials=/root/.credentials,uid=1000,umask=000,user   0 0/.credentials,uid=1000,umask=000,user   0 0"  >> /etc/fstab
typo, should be
sudo echo "//192.168.1.2/share  /smb-share/backup   smbfs  auto,credentials=/root/.credentials,uid=1000,umask=000,user   0 0"  >> /etc/fstab
Avatar of bmsjeff

ASKER

when I:
sudo apt-get install smbfs smbclient

I get:
E: Invalid operation smbfs
OK, no smbfs for Ubuntu
just
sudo apt-get install samba