OVH Community, your new community space.

How to Backup an OVH Dedicated Server


Myatu
06-09-2009, 18:17
No, only FTP.

BiagioParuolo
06-09-2009, 09:45
Quote Originally Posted by ruperthair
Can we use rsync over ssh to backup to the 'ftpback' hosts? I've not seen this documented anywhere.
Is true?

freshwire
13-06-2009, 04:47
I have corrected my lazyness

freshwire
12-06-2009, 23:07
^ Yes it gets even more lazy. I just stop mysql before hand... then turn it back on again. All in all the process is taking less than 1 second total with the small amount of data I have.

Palad1n
12-06-2009, 15:40
Quote Originally Posted by monkey56657
mysqldump --opt -u ???? -p??? --all-databases | bzip2 -c > $DB_ARCHIVE

^ interesting. I am lazy just copy /var/lib/mysql lol
Hi,

Very bad....

The files there are NOT acceptable backup files, if there is a transaction or lock in process then the file will not be complete.

My way is the MySQL approved way of getting a backup that is also in the state that can be restored easily.

freshwire
11-06-2009, 21:07
mysqldump --opt -u ???? -p??? --all-databases | bzip2 -c > $DB_ARCHIVE

^ interesting. I am lazy just copy /var/lib/mysql lol

Palad1n
11-06-2009, 20:02
Hi,
OK I am unable to get RSYNC to work over FTP.
I got it working via SSH using Private Keys.
From my OVH server to a VPS node with another provider.

I created a BASH Script in /usr/local/bin/daily-backup.sh.
CHMOD +x daily-backup.sh.
#/bin/sh
#
echo ----------------------
echo -- Backup Started --
echo ----------------------
#
#Directory that holds the database backup:
DB_BACKUP_DIR=/home/backups/dbdump
# Directories to rsync:
DIRS_TO_RSYNC="/"
# Misc Bits:
SUFFIX1=`date +%Y-%m-%d`
#
DB_ARCHIVE=$DB_BACKUP_DIR/MySQL_Daily_Backup.$SUFFIX1.sql.bz2
# Create the MySQLDump file, compress with bzip2:
mysqldump --opt -u ???? -p??? --all-databases | bzip2 -c > $DB_ARCHIVE
#
# Create Backup on ?? using date as filename:
#
rsync -arvztplgoe 'ssh -p 5381' --exclude-from="/etc/rsync.exclude" $DIRS_TO_RSYNC user@remoteserver:/backups/servername/Daily-Backup
#
echo ------------------------
echo -- Backup Completed --
echo ------------------------
File /etc/rsync.exclude :
proc/
mnt/
dev/
media/
tmp/
quota.group
quota.user
sys/
var/log/
temp/
var/lib/
*.pid
lost+found/
opt/
selinux/
var/run/
var/temp/
var/tmp/
var/spool/
var/lock/
etc/Bastille/
This creates a backup every night at 01:00 (using CRONTAB).
On the Remote VPS at 05:00 a CRON JOB tar's up the directory and saves a copy using the current date/time.

This allows me to keep a historic backup archive.

Next Steps / ToDo:

  • Get RSYNC to upload directly to LiveDrive from Source Servers via FTP or check if LiveDrive supports SCP/SSH/SFTP.
  • Test a RESTORE to another OVH Server or VMWare Server.
  • Validate what I am backing up is needed.
  • Test RSNAPSHOT program.


If anyone has any advice, feel free to comment.

Ashley
11-06-2009, 15:02
I can connect using rsync, accept the key, but my password is always incorrect. Thats why I was a bit offensive.

However using my server as a SOCKS5 tunnel, I am able to FTP directly from my work.

ruperthair
11-06-2009, 14:33
Quote Originally Posted by Ashley
Well the fact that it is FTP which runs as it's own daemon and has seperate account management unless there is a bridge between the daemon and the system's user management
I'd like to see an example of an an FTP daemon that can not use system accounts. I know that some of them can use their own authentication systems but I also know that there are FTP servers that exclusively use systems accounts.

Quote Originally Posted by Ashley
oh and that you are trying to use RSYNC which uses SSH (like SFTP).
I was trying to use rsync as Neil and fozle suggested that I could use it instead of FTP. Also FYI: rsync does not necessarily use ssh.

Quote Originally Posted by Ashley
So quite.
Thanks! I'd much rather be stupid than a ****.

Ashley
11-06-2009, 14:09
Quote Originally Posted by ruperthair
Wow! How stupid do you think I am?
Well the fact that it is FTP which runs as it's own daemon and has seperate account management unless there is a bridge between the daemon and the system's user management - oh and that you are trying to use RSYNC which uses SSH (like SFTP). So quite.

ruperthair
11-06-2009, 13:15
Quote Originally Posted by Neil
Hi

The easiest process would be to use just normal rysnc and run it as a cron:

The command would be:

rsync -avz ~/home (or what ever directory)/ ftpbackup@ovh.net:~/backup.bak/home (or what ever directory)/
Neil seemed to suggest that we can use rsync for backups too.

fozl
11-06-2009, 12:39
Quote Originally Posted by ruperthair
Wow! How stupid do you think I am?
Error on my part in my previous post. You have to use the ftp command, I was thinking of the way I backup to usb drives, not to the ftp backup facility.

ruperthair
11-06-2009, 12:23
Quote Originally Posted by Ashley
Thats because RSYNC is a different protocol to FTP.
Wow! How stupid do you think I am?

Ashley
11-06-2009, 12:18
Thats because RSYNC is a different protocol to FTP.

ruperthair
11-06-2009, 11:32
Quote Originally Posted by fozle
Yes you can, but only from the server you have the ftp backup for of course.
It doesn't work for me. Should it be the same backup host, user name and password as the FTP?

This works fine:

Code:
ncftp ftp://ns301918.ovh.net@ftpback12.ovh.net/
This does not let me in:

Code:
rsync foo ns301918.ovh.net@ftpback12.ovh.net:

Palad1n
11-06-2009, 11:25
Quote Originally Posted by Neil
Hi

The easiest process would be to use just normal rysnc and run it as a cron:

The command would be:

rsync -avz ~/home (or what ever directory)/ ftpbackup@ovh.net:~/backup.bak/home (or what ever directory)/

The avz means it will keep file permissions and compress it for upload.

Then you need to save this as a script and then can turn it into a cron job so it is execute every so often.

Hope that helps.
Thanks, but that does not keep historic backups.

I was thinking of a Sunday Full Backup (Whole / folder) with Daily Incremental Updates.

Or with the RSYNC command can you add a %DATE% to the file name to keep versions?

Thanks

fozl
11-06-2009, 11:06
Quote Originally Posted by ruperthair
Can we use rsync over ssh to backup to the 'ftpback' hosts? I've not seen this documented anywhere.
Yes you can, but only from the server you have the ftp backup for of course.

Andy
11-06-2009, 11:01
Another vote for rsync here. If you use Windows there is an rsync port called DeltaCopy which I use, and its a client/server application too. Not sure if you can use just the client side of it to rsync from Windows > Linux though. Never tried, probably never will

ruperthair
11-06-2009, 10:17
Can we use rsync over ssh to backup to the 'ftpback' hosts? I've not seen this documented anywhere.

Neil
11-06-2009, 09:31
Hi

The easiest process would be to use just normal rysnc and run it as a cron:

The command would be:

rsync -avz ~/home (or what ever directory)/ ftpbackup@ovh.net:~/backup.bak/home (or what ever directory)/

The avz means it will keep file permissions and compress it for upload.

Then you need to save this as a script and then can turn it into a cron job so it is execute every so often.

Hope that helps.

Palad1n
11-06-2009, 09:16
Hi All,

Can you please share with me how you backup your OVH dedicated servers.

I am looking into something more than Weekly Cron job in Webmin to tar up /home & /var/www directories and upload to LiveDrive via FTP.

I want to try and get to a Bare-Metal-Restore ability, so I can restore the backup file to another OVH Server (hardware independant?). I also want the backup to be independant of the software, Cpanel/Plesk/LXAdmin etc.

I don't mind paying for a product, but a free solution would be good, one that can compress, transfer via FTP/Rsync etc.

Note: Please do not say Google it, I have done that and found several, but some require Kernel drivers/mods so OVH Kernel makes this imposible without changing Kernels.

Any ideas?

Please include links to sites if you can.

Cheers