LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 04-15-2013, 04:21 AM   #1
cabrilo
LQ Newbie
 
Registered: Nov 2004
Posts: 17

Rep: Reputation: 0
Backup solution like rsnapshot that's easy on the hard disks...


Hello everyone!

Currently, I have one server which I use to keep backups from various places. I use rsnapshot and keep backups of 3 remote servers, as well as some local directories. So, there is a lot of files to sync.

The problem is, rsnapshot is very slow, especially when it's removing directories, which can take literally hours (and this is amplified by the fact that I use relatively slow hard disks for storage - both for their price and to keep the server quiet as it's in my office). I'd like to do hourly backups every 4 hours, but it will, every once in a while, take more than 3-4 hours to complete one backup cycle!

Are there any other incremental backup solutions which are as simple as rsnapshot (which is very nice otherwise) but are better suited for a large number of files?

Thanks
 
Old 04-15-2013, 07:11 PM   #2
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora/Pop!_OS
Posts: 2,983

Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
just create a basic bash script that will use rsync and if you want to have rsync remove defunct files i believe there is a delete option you can flag, see the man page for the exact syntax.

a simple basic script could as easy as:

Code:
#!/bin/bash

### set your variables

DTSTAMP="`date +%Y-%m-%d-%H.%M.%S `"
RUSER=remote_user_name
RHOST=remote_IP_backup_server    ### or DNS host name if you have that configured ###
LDIR=/path/to/local/dir/to/backup
RDIR=/path/on/backup/server/to/store/data
DOW=`date +%A`
LOG=/path/to/log/file/${DTSTAMP}-rsync.log

### call the rsync portion

     rsync -aviS --exclude-from=/path/to/excludes.txt ${LDIR}/ ${RUSER}@${RHOST}:/${DOW}/ >> ${LOG} 2>&1

### clean up your log files

find /path/to/log/files/*.log -mtime +30 -exec rm '{}' \;

exit
This will store 7 days worth of data from each of the servers that are set to run. also keep in mind if you have this set to PUSH from the remote servers into the backup server you CAN run them all at the same time, but keep in mind your I/O and Network performance might suffer if you do this. I might be a good idea to stager the start times of each remote server by 15-20min that way you can still have them all run every hour.

your needs may very, but this is a start and again very basic.
 
Old 04-16-2013, 02:09 AM   #3
sajansijin@ymail.com
LQ Newbie
 
Registered: Apr 2013
Posts: 1

Rep: Reputation: Disabled
Hi lleb,

It seems the password would be prompted for when we run this script.

Can this be avoided with an attribute in rsync itself.?
 
Old 04-16-2013, 02:47 AM   #4
cabrilo
LQ Newbie
 
Registered: Nov 2004
Posts: 17

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by lleb View Post
just create a basic bash script that will use rsync and if you want to have rsync remove defunct files i believe there is a delete option you can flag, see the man page for the exact syntax.
Thanks for the reply. There is a problem though: If I understand correctly, each of 7 days stores a full copy of everything. Given that I currently keep 6 snapshots a day, 7 daily, 4 weekly, 12 monthly and 4 yearly, that would quite quickly fill up my disks (that would be 30 copies of everything). Rsnapshot solves this by keeping hard links to same files.
 
Old 04-16-2013, 08:36 AM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,356

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
@sajansijin@ymail.com: tell rsync to use ssh and ssh auth-keys
 
Old 10-13-2013, 07:08 PM   #6
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora/Pop!_OS
Posts: 2,983

Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
Quote:
Originally Posted by sajansijin@ymail.com View Post
Hi lleb,

It seems the password would be prompted for when we run this script.

Can this be avoided with an attribute in rsync itself.?
look at both the links in my signature, and my script again.

as you are using user@remote_location, this is over ssh and with ssh keys you will not be prompted for a p/w if configured properly.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Create image for your hard drive the easy way with Redo Backup and Recovery LXer Syndicated Linux News 0 07-06-2010 04:40 PM
Backup VM using rsnapshot cccc Linux - Virtualization and Cloud 3 02-05-2010 08:35 AM
Easy Ubuntu 6.06 (Dapper)Full Backup Solution... pazz33 Linux - Newbie 4 06-14-2007 07:05 PM
Getting hard disks working for backup-- some problems loninappleton Linux - Newbie 0 10-20-2004 11:33 PM
Backup whole hard drive solution Swift&Smart Linux - Software 1 07-24-2004 11:05 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 06:24 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration