[HOWTO] Daily incremental backup with rsnapshot

Discussion on remote replication.
Post Reply
Breezer
Starting out
Posts: 26
Joined: Fri Feb 08, 2008 3:24 am
Location: Belgium

Re: [HOWTO] Daily incremental backup with rsnapshot

Post by Breezer »

Great manual Crushdepth, do you already have the restore tested and described step-by-step ?

Cheers,

Johan
Qnap TS-409 Pro + 4 x 500GB WDC WD5000AAKS-00YGA12.0
Qnap TS-859 Pro + 8 x 2 TB WD20EADS-00R6B0
Chris S
Starting out
Posts: 10
Joined: Fri Sep 24, 2010 4:37 pm

Re: [HOWTO] Daily incremental backup with rsnapshot

Post by Chris S »

DasUli wrote:Just for the record, i formatted the usb drive with ext4, now it´s working fine. The problem was the NTFS file system. Thanks for input, Mike!
Was the problem only with copying files using windows?

I make my backups to a share folder in the qnap. Id like to be able to restore those backups through the web file manager. Will that be possible?
My iscsi partitions are all ntfs.
bramschats
Easy as a breeze
Posts: 440
Joined: Thu Apr 23, 2009 1:51 am

Re: [HOWTO] Daily incremental backup with rsnapshot

Post by bramschats »

Great guide crushdepth,

If you only could at email log sending,which is not working for me so far, at your howto it would be complete.......
Qnap TS-453D
Regor
Know my way around
Posts: 154
Joined: Mon Dec 31, 2007 6:36 pm
Location: Paris

Re: [HOWTO] Daily incremental backup with rsnapshot

Post by Regor »

Great guide crushdepth :shock: 8) !!
and thanks to efaden for the mail script

humm I was wondering if Qnap forum team talk together ?
I've just found this http://forum.qnapclub.de/viewtopic.php?f=208&t=10097 !
And as I don't speak germain can someone translate this ? I think it about a rsnashot GUI ....

and
bramschats wrote:Great guide crushdepth,
If you only could at email log sending,which is not working for me so far, at your howto it would be complete.......
it's really a copy/paste in a xx.sh file and change the email adress parameters...
from efaden post here http://forum.qnap.com/viewtopic.php?f=2 ... 45#p104819
TS-109 fw 3.3.0 build 0924T
TS-239 Pro II + QTS 4.0.2.20130726
bramschats
Easy as a breeze
Posts: 440
Joined: Thu Apr 23, 2009 1:51 am

Re: [HOWTO] Daily incremental backup with rsnapshot

Post by bramschats »

Regor,

thnx, i've made the script and crontab entry and put in my settings as discribed in http://forum.qnapclub.de/viewtopic.php?f=208&t=10097 how can i test this is working?

thnx in advance.
Qnap TS-453D
Regor
Know my way around
Posts: 154
Joined: Mon Dec 31, 2007 6:36 pm
Location: Paris

Re: [HOWTO] Daily incremental backup with rsnapshot

Post by Regor »

Hi,
bramschats wrote:Regor,

thnx, i've made the script and crontab entry and put in my settings as discribed in http://forum.qnapclub.de/viewtopic.php?f=208&t=10097 how can i test this is working?

thnx in advance.
As I said I don't speak german ... so I don't know how to implement their scripts ...
TS-109 fw 3.3.0 build 0924T
TS-239 Pro II + QTS 4.0.2.20130726
bramschats
Easy as a breeze
Posts: 440
Joined: Thu Apr 23, 2009 1:51 am

Re: [HOWTO] Daily incremental backup with rsnapshot

Post by bramschats »

Regor,

sorry i meant this threat http://forum.qnap.com/viewtopic.php?f=2 ... 45#p104819 for emailing.....
Qnap TS-453D
User avatar
Q
Experience counts
Posts: 1436
Joined: Wed Sep 05, 2007 4:18 pm
Location: Switzerland
Contact:

Re: [HOWTO] Daily incremental backup with rsnapshot

Post by Q »

I've just found this http://forum.qnapclub.de/viewtopic.php?f=208&t=10097 !
And as I don't speak germain can someone translate this ? I think it about a rsnashot GUI ....
yeah it is :) working great! frosch2 did a really good job. i already tested the v2 beta (not released yet to the public) and it's even more awesome :D translation to english is planned for the future, but currently it's impossible to say when it will be ready.
I am Q
www.qnap.ch

I don't work at QNAP.
And RAID is really NO backup!
Regor
Know my way around
Posts: 154
Joined: Mon Dec 31, 2007 6:36 pm
Location: Paris

Re: [HOWTO] Daily incremental backup with rsnapshot

Post by Regor »

bramschats wrote:Regor,

sorry i meant this threat http://forum.qnap.com/viewtopic.php?f=2 ... 45#p104819 for emailing.....
ahh
just verify the ligne where the address mail is written and the path to the rsnapshot log
for trying, comment the last ligne with # where the temp log is remove and... run it and when it's ok uncomment the line

I advise you to run this by adding in rsnapshot.conf the cmd "cmd_postexec tab the-path/to-your-script.sh", in that way the script will be rune at each rsnapshot backup ... (look at the how-to of rsnapshot.org)
here is what I add in the rsnapshot.conf just after the cmd_du command
...
# Uncomment this to specify a path to "du" for disk usage checks.
cmd_du /opt/bin/du

# commande post execution
cmd_postexec /share/Qsauv/rsnapshot-maillog.sh


#########################################
# BACKUP INTERVALS #
# Must be unique and in ascending order #
# i.e. hourly, daily, weekly, etc. #
#########################################

...

Hope this help
TS-109 fw 3.3.0 build 0924T
TS-239 Pro II + QTS 4.0.2.20130726
bramschats
Easy as a breeze
Posts: 440
Joined: Thu Apr 23, 2009 1:51 am

Re: [HOWTO] Daily incremental backup with rsnapshot

Post by bramschats »

Regor,

I have created the script in /share/MD0_DATA/System/rsnapshot_log.sh with the script and edited my mail settings.

Code: Select all

MAIL_TO="my@email.com"                                           
MAIL_HEADER_TO="Me <my@email.com>"         
MAIL_HEADER_FROM="QNAP <qnap@email.com>"   
I have made a crontab entry: 55 23 * * * /share/MD0_DATA/System/rsnapshot_log.sh
for trying, comment the last ligne with # where the temp log is remove and... run it and when it's ok uncomment the line
But how can i start the script and make it executable?

Do i need to add this in this file?
Add the alias in to /etc/config/ssmtp/revaliases...
I did put this line in in: /opt/etc/rsnapshot.conf beneath:

Code: Select all

cmd_du /opt/bin/du

# commande post execution
cmd_postexec /share/MD0_DATA/System/rsnapshot_log.sh
thanks in advance.
Qnap TS-453D
Regor
Know my way around
Posts: 154
Joined: Mon Dec 31, 2007 6:36 pm
Location: Paris

Re: [HOWTO] Daily incremental backup with rsnapshot

Post by Regor »

Hi,
I have created the script in /share/MD0_DATA/System/rsnapshot_log.sh with the script and edited my mail settings.

MAIL_TO="my@email.com"
MAIL_HEADER_TO="Me <my@email.com>"
MAIL_HEADER_FROM="QNAP <qnap@email.com>"
seems ok, if you put the real email address not my@email.com neither qnap@email.com !
I have made a crontab entry: 55 23 * * * /share/MD0_DATA/System/rsnapshot_log.sh
not needed if you add cmd_postexec ...
But how can i start the script and make it executable?
at prompt : chmod +x /share/MD0_DATA/System/rsnapshot_log.sh
and at prompt : /share/MD0_DATA/System/rsnapshot_log.sh <enter>
Do i need to add this in this file?

Add the alias in to /etc/config/ssmtp/revaliases...
I didn't add it but it works
I did put this line in in: /opt/etc/rsnapshot.conf beneath:

cmd_du /opt/bin/du

# commande post execution
cmd_postexec /share/MD0_DATA/System/rsnapshot_log.sh
so you won't need entry in crontab

verify that you use TAB between cmd_postexec and /share/MD0_DATA/System/rsnapshot_log.sh
or you will have an error

hope this help ...
TS-109 fw 3.3.0 build 0924T
TS-239 Pro II + QTS 4.0.2.20130726
bramschats
Easy as a breeze
Posts: 440
Joined: Thu Apr 23, 2009 1:51 am

Re: [HOWTO] Daily incremental backup with rsnapshot

Post by bramschats »

thnx,

yes it works but having also an error when testing:

Code: Select all

[/share/MD0_DATA/System] # /share/MD0_DATA/System/rsnapshot_log.sh
----------------------------------------------------------------------------
rsnapshot encountered an error! The program was invoked with these options:
/opt/bin/rsnapshot du
----------------------------------------------------------------------------
ERROR: /opt/etc/rsnapshot.conf on line 62:
ERROR: cmd_postexec /share/MD0_DATA/System/rsnapshot_log.sh
ERROR: ---------------------------------------------------------------------
ERROR: Errors were found in /opt/etc/rsnapshot.conf,
ERROR: rsnapshot can not continue. If you think an entry looks right, make
ERROR: sure you don't have spaces where only tabs should be.
[/share/MD0_DATA/System] #
on line 62 in rsnapshot i have:

Code: Select all

# commande post execution
cmd_postexec    /share/MD0_DATA/System/rsnapshot_log.sh
What is going wrong here.
Qnap TS-453D
Regor
Know my way around
Posts: 154
Joined: Mon Dec 31, 2007 6:36 pm
Location: Paris

Re: [HOWTO] Daily incremental backup with rsnapshot

Post by Regor »

Hi,
# commande post execution
cmd_postexec /share/MD0_DATA/System/rsnapshot_log.sh
What is going wrong here.
is there any SPACE charactere between cmd_postexec and /share/.... ?
It must be a TAB charactere !
TS-109 fw 3.3.0 build 0924T
TS-239 Pro II + QTS 4.0.2.20130726
bramschats
Easy as a breeze
Posts: 440
Joined: Thu Apr 23, 2009 1:51 am

Re: [HOWTO] Daily incremental backup with rsnapshot

Post by bramschats »

thanks,

now it is working without errors, great.

this is my etc/config/crontab

Code: Select all

0 */4 * * * /opt/bin/rsnapshot hourly
30 23 * * * /opt/bin/rsnapshot daily
30 22 * * 0 /opt/bin/rsnapshot weekly
30 21 1 * * /opt/bin/rsnapshot monthly
but my script only starts manually by typing /share/MD0_DATA/System/rsnapshot_log.sh or running for example rsnapshot hourly:

Code: Select all

[~] # rsnapshot hourly
echo 21496 > /opt/var/run/rsnapshot.pid
/opt/bin/rm -rf /opt/var/rsnapshot/hourly.5/
mv /opt/var/rsnapshot/hourly.4/ /opt/var/rsnapshot/hourly.5/
mv /opt/var/rsnapshot/hourly.3/ /opt/var/rsnapshot/hourly.4/
mv /opt/var/rsnapshot/hourly.2/ /opt/var/rsnapshot/hourly.3/
mv /opt/var/rsnapshot/hourly.1/ /opt/var/rsnapshot/hourly.2/
mv /opt/var/rsnapshot/hourly.0/ /opt/var/rsnapshot/hourly.1/
mkdir -m 0755 -p /opt/var/rsnapshot/hourly.0/
/opt/bin/rsync -a --delete --numeric-ids --relative --delete-excluded \
    --link-dest=/opt/var/rsnapshot/hourly.1/localhost/ \
    /share/MD0_DATA/Public /opt/var/rsnapshot/hourly.0/localhost/
touch /opt/var/rsnapshot/hourly.0/
/share/MD0_DATA/System/rsnapshot_log.sh
rm -f /opt/var/run/rsnapshot.pid
[~] #
But it does not start automatic in crontab!

What am i doing wrong here?
Qnap TS-453D
Regor
Know my way around
Posts: 154
Joined: Mon Dec 31, 2007 6:36 pm
Location: Paris

Re: [HOWTO] Daily incremental backup with rsnapshot

Post by Regor »

Did you reload crontab ?
At prompt : crontab /etc/config/crontab
And to verify crontab -l
TS-109 fw 3.3.0 build 0924T
TS-239 Pro II + QTS 4.0.2.20130726
Post Reply

Return to “Remote Replication/ Disaster Recovery”