[SOLVED] Run Backup Daily

Moderator: crythias

Post Reply
rcsdownload
Znuny newbie
Posts: 23
Joined: 29 May 2015, 10:59
Znuny Version: 4.0.7
Real Name: RCS

[SOLVED] Run Backup Daily

Post by rcsdownload »

Just want to know if this are the correct way to backup the whole system?
Say, if the server crashed, will I be able to restore it completely with all these backups?
- Application.tar.gz
- Config.tar.gz
- Database Backup.sql.gz

Also, how to run backup daily?

Thank you so much
Last edited by rcsdownload on 26 Jun 2015, 11:14, edited 1 time in total.
RStraub
Znuny guru
Posts: 2210
Joined: 13 Mar 2014, 09:16
Znuny Version: 6.0.14
Real Name: Rolf Straub

Re: Run Backup Daily

Post by RStraub »

Depends how you define it.

With those files you will be able to restore all data and configuration - yes.
But it will not take care of a broken server, e.g. modules are missing or perl isn't installed.

Daily backup is best run via the backup script and a cron job.
Currently using: OTRS 6.0.14 -- MariaDB -- Ubuntu 16 LTS
rcsdownload
Znuny newbie
Posts: 23
Joined: 29 May 2015, 10:59
Znuny Version: 4.0.7
Real Name: RCS

Re: Run Backup Daily

Post by rcsdownload »

Thank you for your reply.

Can help me how to do it via cron?
RStraub
Znuny guru
Posts: 2210
Joined: 13 Mar 2014, 09:16
Znuny Version: 6.0.14
Real Name: Rolf Straub

Re: Run Backup Daily

Post by RStraub »

Assuming you run it as otrs user and the $HOME is set (else use absolute path), the cron entry could look like this:
(Backup will be valid for 30 days and then deleted)

Code: Select all

# Create a internal backup of the system every day at 5:05 am
05 05 * * * $HOME/scripts/backup.pl -d /opt/otrs-backup/ -c gzip -r 30 -f fullbackup
Currently using: OTRS 6.0.14 -- MariaDB -- Ubuntu 16 LTS
rcsdownload
Znuny newbie
Posts: 23
Joined: 29 May 2015, 10:59
Znuny Version: 4.0.7
Real Name: RCS

Re: Run Backup Daily

Post by rcsdownload »

Thank you.

I'm actually running it on CentOS and using a docker container
my orig backup files are in /opt/otrs/scripts/backup.pl
and the backup I created (tar.gz files) are inside /opt/backup/

Will the command be:
05 05 * * * $opt/otrs/scripts/backup.pl -d /opt/backup/ -c gzip -r 30 -f fullbackup

Thank you.
Last edited by rcsdownload on 26 Jun 2015, 10:01, edited 1 time in total.
jojo
Znuny guru
Posts: 15019
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

Re: Run Backup Daily

Post by jojo »

man crontab and man 5 crontab should help. Also your Lunux Admin should be able to consult you on this question
"Production": OTRS™ 8, OTRS™ 7, STORM powered by OTRS
"Testing": ((OTRS Community Edition)) and git Master

Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
rcsdownload
Znuny newbie
Posts: 23
Joined: 29 May 2015, 10:59
Znuny Version: 4.0.7
Real Name: RCS

Re: Run Backup Daily

Post by rcsdownload »

Thank you RStraub! :)
RStraub
Znuny guru
Posts: 2210
Joined: 13 Mar 2014, 09:16
Znuny Version: 6.0.14
Real Name: Rolf Straub

Re: Run Backup Daily

Post by RStraub »

rcsdownload wrote: Will the command be:
05 05 * * * $opt/otrs/scripts/backup.pl -d /opt/backup/ -c gzip -r 30 -f fullbackup
This will not work, replace the $ infront of opt with a slash.
Currently using: OTRS 6.0.14 -- MariaDB -- Ubuntu 16 LTS
rcsdownload
Znuny newbie
Posts: 23
Joined: 29 May 2015, 10:59
Znuny Version: 4.0.7
Real Name: RCS

Re: Run Backup Daily

Post by rcsdownload »

Ah yes did that!

Thank you so much RStraub!
It's now OK.

Thank you :)
Post Reply