Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


How do you backup your VPS?
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

How do you backup your VPS?

vahevahe Member
edited March 2012 in General

I was wondering what you guys use to backup your VPS. I'm currently using rsnapshot to backup some directories. Are there any scripts that would backup everything? What are the best options to setup remote automated backups?

«1

Comments

  • netomxnetomx Moderator, Veteran

    rsync is easy too, with cron

  • vahevahe Member

    @jtodd said: I've been using this for years for databases:

    http://forums.kayako.com/threads/cron-job-to-backup-kayako-owned-db.8202/#post-40471

    Looks like this is ftp'ing the backup to the backup server. Would transferring the backup hurt the performance of the websites running on the server?

  • vahevahe Member

    @netomx said: rsync is easy too, with cron

    Are you running rsync as root on the server? If yes, is it secure?
    Is there a way to backup directories like /etc or /var/log while running as a regular user?

  • Why would you want to backup the log files?

  • rsync have been working for me to transfer a full directory containing updated files. And I keep a local backup in the same VPS.

  • I thought we had enought threads about this

    http://www.lowendtalk.com/discussions/tagged/backup

    Thanked by 2marrco Infinity
  • @speckl said: Why would you want to backup the log files?

    In anyway he will be able to use logrotate tool to compress old logs, and sending them to email with time interval, it can be set depending on how frequent log files gets big to keep it low in size (but compressed anyway saves a lot).

  • vahevahe Member

    @yomero said: I thought we had enought threads about this

    Didn't know how to search tags. Regular search didn't produce any useful results.
    Thanks

  • @vahe said: Didn't know how to search tags. Regular search didn't produce any useful results.

    Thanks

    I don't know too xD
    But, in the main page at the right bottom you can see a list, so you can try replacing the link with the proper tag :P

  • raindog308raindog308 Administrator, Veteran

    So I too do the ol' "rsync to another server" method - hostigation backup VPS.

    But on my toodledo are two things to solve:

    • if someone hacks into my VPS, they would have access to my backup as well, since it's a nightly rsync-over-ssh. How best to fix? I suppose I could pull from the backup side, though that is really the same problem.

    • there's no versioning. For the MySQL DBs, I do version, deleting after 7 days. But for most things I don't. If I introduce a problem, next time backups run, I can't go back to an earlier version. I thought about doing versioned tars of /etc instead, since it's small.

    Unfortunately, most of the proper backup client solutions seem a lot more expensive.

  • @vahe said: Didn't know how to search tags. Regular search didn't produce any useful results.

    @yomero said: I don't know too xD

    use google search with site:lowendtalk.com as usual? :D

  • @raindog308 said: if someone hacks into my VPS, they would have access to my backup as well, since it's a nightly rsync-over-ssh. How best to fix? I suppose I could pull from the backup side, though that is really the same problem.

    Yes, you would need to pull from the backup side. Just put a key in the main vps and let the backup side call the rsync. Then you would lock down access to the backup server as strict as possible. That's about the best you can do.

    Thanked by 1tux
  • I recently found tarsnap, the service seems to be very useful, I still can't get it to work in crontrab but it's probably a problem with the command I'm using.

  • raindog308raindog308 Administrator, Veteran

    Yeah, tarsnap is neat. But expensive. I don't really store anything super-secret on my VPSes (they're web servers, after all).

    S3/azure is another option and reasonably priced and offers versioning, which protects against attacks because you can go back to old versions. The number of I/O ops is an extra cost and your typical web tree would make that expensive. Perhaps some kind of tarball staging...hmmm...I hate backup systems where I have to list what I want to backup, as that inevitably leads to something new not getting in the list.

  • i use lftp mirror

  • gsrdgrdghdgsrdgrdghd Member
    edited March 2012

    @raindog308 said: Perhaps some kind of tarball staging

    I use Duply/Duplicity with encrypted backups to S3, works like a champ :)

    Thanked by 1bill32
  • JacobJacob Member

    FTP Individually backing up each container.

  • @raindog308 said: Yeah, tarsnap is neat. But expensive.

    Well I'm planing to use it to backup small databases only, so I guess those 5 bucks will last a couple of years :P

  • KuroKuro Member

    I use rsync to incrementally backup the entire disk on each of my VPSs hourly. I store the last 24 hourly backups, 7 daily backups, and then indefinitely store weekly backups. I make use of hard links to save space instead of keeping multiple copies of identical files.

    For security, I have a dedicated rsync user on each of my VPSs, that is only allowed to execute the rsync process via sudo (this allows me to backup files that the rsync user doesn't have access permissions for). If my backup VPS was hacked, then the only thing the hackers would be able to access on my other VPSs is rsync --server :P

  • rskrsk Member, Patron Provider

    There was a script i stumbled upon, that automatically backs up your content and then sends it to your dropbox account. I thought it was a good free solution :P

  • @Kuro How do you do that? Scripting with tar and rsync? Can you give an example with the hardlinks?

  • you can't go wrong with rsnaphot for that. If you need encrypted backups look at duply/duplicity

    Thanked by 1djvdorp
  • @pineapple said: i use lftp mirror

    The lack of people knowing/using lftp is astonishing. I love me some lftp.

    Thanked by 2djvdorp Damian
  • netomxnetomx Moderator, Veteran

    @vahe said: Are you running rsync as root on the server? If yes, is it secure?

    Is there a way to backup directories like /etc or /var/log while running as a regular user?

    Maybe, but I don't knoe. I use root.

  • InfinityInfinity Member, Host Rep

    He's most likely using SSH keys so it should be fairly secure.

  • @Infinity said: He's most likely using SSH keys so it should be fairly secure.

    But doesn't that mean that whent he backup server gets compromised and the SSH keys stolen, the attacker will have root access to all other servers too?

  • instead of using root user, just create a dedicated backup user and give him read only access to the data you want to backup

  • CBebopCBebop Member
    edited March 2012

    For my backup I use rsnapshot to pull all the data I need from each server. I shut down everything that wasn't needed, including sshd, and blocked all ports. If I need to access the VPS I can always go in through SolusVM to turn on sshd with the console and get what I need off of it.

    Edit: I backup using root and certs. All my VPSes are set to allow only certs for root login and the backup server is the only one with certificates to get in. I use a normal user and sudo for anything I need to do.

  • netomxnetomx Moderator, Veteran

    @gsrdgrdghd said: But doesn't that mean that whent he backup server gets compromised and the SSH keys stolen, the attacker will have root access to all other servers too?

    yes, but there are ways to avoid that

Sign In or Register to comment.