Page 1 of 1

Automated Hoteldruid Backups?

Posted: Tue Jul 15, 2014 1:19 pm
by clayhawks
Marco, I've installed this wonderful system you've developed and I thank you. Do you know of a way to run backups in an automated way? In the web interface I can obviously push the "Create a New Backup File" button and get a valid backup file. I have done so and have been able to successfully restore the data to a backup server. I would like to be able to script the backup in such a way that it happens without user interaction and on a schedule.

Thanks again!

Re: Automated Hoteldruid Backups?

Posted: Thu Nov 26, 2015 6:48 pm
by marco
It depends on your system which tools you can use to periodically call an URL (cron job with wget, etc.) and there other forums over the Internet where it's more appropriate to discuss this. For what concerns hoteldruid the URLs that must be called to create and download the backup are:

http://yourdomain.com/hoteldruid_path/c ... _backup=SI

http://yourdomain.com/hoteldruid_path/c ... _backup=SI

where you must replace $USER and $PASS whit the username and password of an hoteldruid user that is able to create backups and $YEAR with current hoteldruid year.

Regards,
Marco

Re: Automated Hoteldruid Backups?

Posted: Mon Feb 13, 2017 1:14 am
by clayton256
Hi Marco,

Should this approach to automated backups still work with version 2.1.4? I tried a couple of wget calls in a bash script substituting real values for the variables as such:

Code: Select all

#! /bin/bash

USER=backup
PASS=secrets
YEAR=2017

wget http://lizzy.local./hoteldruid/crea_backup.php?nome_utente_phpr=$USER&password_phpr=$PASS&anno=$YEAR&crea_backup=SI
wget http://lizzy.local./hoteldruid/crea_backup.php?nome_utente_phpr=$USER&password_phpr=$PASS&anno=$YEAR&mostra_header=NO&salva_backup=SI
The wget calls download files called: crea_backup.php?nome_utente_phpr=backup, crea_backup.php?nome_utente_phpr=backup.1, crea_backup.php?nome_utente_phpr=backup.2... But never cause a hoteld_backup.php file to be created. I do see a hoteld_backup.php.lock file if that is useful info.

Where should I start to investigate what is going wrong?

Thanks for any help you can offer!

Mark Clayton

Re: Automated Hoteldruid Backups?

Posted: Tue Mar 21, 2017 10:26 pm
by Matteo46
Hi clayton256,
I wrote this script for my backups, it use mysqldump for the database, tar for the file and then this script https://github.com/andreafabrizi/Dropbox-Uploader to upload all in dropbox. The backups will be organized in folder like HD-YEAR-MONTH and inside the backups of each days (you can use a cronjob each night). When the space is full you can easily delete from dropbox entire month with just 1 click.

Hope it can help you.

Code: Select all

#!/bin/bash

td=tmpbackup

giorno=$(date +%d)
file=hd-$(date +%Y_%m_%d-%H_%M)
cart=$(date +%Y_%m)

/usr/bin/mysqldump -u USER -pPASSWD NAME_DB > $td/$file.sql
tar czfP $td/$file.tgz domains/yoursite.com/public_html/hoteldruid $td/$file.sql

./dropbox_uploader.sh upload $td/$file.tgz /hd-$cart/$giorno/$file.tgz

rm $td/$file.tgz
rm $td/$file.sql

Re: Automated Hoteldruid Backups?

Posted: Tue Apr 18, 2017 1:40 pm
by clayton256
Hi Matteo46,

Thanks for your reply. Sorry I didn't see your reply until now. I thought I would get an notification on this thread but I didn't.

I went down this same path before I heard about the builtin backup/restore feature. Ultimately, I'm trying to build a link
between two installs to push changes instead of the builtin's pull mechanism.

Thanks again,
Mark
Matteo46 wrote:Hi clayton256,
I wrote this script for my backups, it use mysqldump for the database, tar for the file and then this script https://github.com/andreafabrizi/Dropbox-Uploader to upload all in dropbox. The backups will be organized in folder like HD-YEAR-MONTH and inside the backups of each days (you can use a cronjob each night). When the space is full you can easily delete from dropbox entire month with just 1 click.

Hope it can help you.

Code: Select all

#!/bin/bash

td=tmpbackup

giorno=$(date +%d)
file=hd-$(date +%Y_%m_%d-%H_%M)
cart=$(date +%Y_%m)

/usr/bin/mysqldump -u USER -pPASSWD NAME_DB > $td/$file.sql
tar czfP $td/$file.tgz domains/yoursite.com/public_html/hoteldruid $td/$file.sql

./dropbox_uploader.sh upload $td/$file.tgz /hd-$cart/$giorno/$file.tgz

rm $td/$file.tgz
rm $td/$file.sql

Re: Automated Hoteldruid Backups?

Posted: Wed Apr 19, 2017 1:47 pm
by Matteo46
Two backups are better than one :mrgreen:

Re: Automated Hoteldruid Backups?

Posted: Thu Jul 27, 2017 10:21 pm
by marco
Hello Mark,
try to use quotes around wget urls. Also the urls are a little wierd (maybe you want to replace "lizzy.local." with "localhost"?).
clayton256 wrote: The wget calls download files called: crea_backup.php?nome_utente_phpr=backup, crea_backup.php?nome_utente_phpr=backup.1, crea_backup.php?nome_utente_phpr=backup.2... But never cause a hoteld_backup.php file to be created. I do see a hoteld_backup.php.lock file if that is useful info.
can you check what these files contain?

Regards,
Marco

Re: Automated Hoteldruid Backups?

Posted: Mon Dec 11, 2017 3:35 am
by nethead
Hi,

the URI's youve posted bring you to the backup interface of hoteldruid but they dont start the download.

Is there any URL parameter to immediatly start the download? Otherwise its not usuable via cron/wget.

cheers,

Arnd

Re: Automated Hoteldruid Backups?

Posted: Tue Jun 05, 2018 8:10 pm
by marco
Hello Arnd,
that's why there are 2 URLs in my original post, one to create the backup and the other to download it.

Regards,
Marco