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.
Linux

Avatar of undefined
Last Comment
wesly_chen
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?
Avatar of farzanj
farzanj
Flag of Canada image

Did you mount the USB directly to the computer?
Avatar of wesly_chen
wesly_chen
Flag of United States of America image

>  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
bmsjeff
Flag of Afghanistan image

ASKER

sorry it is a NAS, not USB.  it is on the network.  Yes ssh via IP or FTP
Avatar of wesly_chen
wesly_chen
Flag of United States of America image

> it is a NAS
Does you support NFS? If yes, can you enable it and tell us the export path?
Avatar of wesly_chen
wesly_chen
Flag of United States of America image

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

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of wesly_chen
wesly_chen
Flag of United States of America image

> 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
bmsjeff
Flag of Afghanistan image

ASKER

when I:
sudo apt-get install smbfs smbclient

I get:
E: Invalid operation smbfs
Avatar of wesly_chen
wesly_chen
Flag of United States of America image

OK, no smbfs for Ubuntu
just
sudo apt-get install samba
Linux
Linux

Linux is a UNIX-like open source operating system with hundreds of distinct distributions, including: Fedora, openSUSE, Ubuntu, Debian, Slackware, Gentoo, CentOS, and Arch Linux. Linux is generally associated with web and database servers, but has become popular in many niche industries and applications.

71K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo