Tool to manage rundeck backups

Another rundeck blog post. In the latest post we talked about how to move rundeck from one server to another, and we found out there are quite a lot of files to handle (ssh key files, rundeck’s configuration, project definitions, job definitions…). Well, with that info, and with the intention of simplify backup tasks, I’ve written a shell-script to manage rundeck backups, backup and recovery. You can find it at github: https://github.com/ersiko/rundeck-backup and right here in in the page project

It works plain simple, you just need to backup like this

[[email protected] ~]# ./rundeck-backup.sh backup rundeck.tar.gz
OK - backup finished successfully using /root/rundeck-backup.tar.gz

If we don’t type the file name, the backup will be written with today’s data:

[[email protected] ~]# ./rundeck-backup.sh backup
OK - backup finished successfully using /root/rundeck-backup-20130327.tar.gz

And for the recovery, as easy as:

[[email protected] ~]# ./rundeck-backup.sh restore
Rundeck service is not running, so jobs can't be restored. Do you want to start rundeck? (y/N) y
Starting rundeckd: [ DONE ]
OK - restore finished successfully using /root/rundeck-backup-20130327.tar.gz

There are also other options, to cover all scenarios I’ve thought of:

[[email protected] ~]# ./rundeck-backup.sh -h
rundeck_backup - v1.00
Copyleft (c) 2013 Tomàs Núñez Lirola under GPL License
This script deals with rundeck backup/recovery.

Usage: ./rundeck-backup.sh [OPTIONS...] {backup|restore} [backup_file] | -h --help

Options:
-h | --help
Print detailed help
--exclude-config
Don't backup / restore config files
--exclude-projects
Don't backup / restore project definitions
--exclude-keys
Don't backup / restore ssh key files
--exclude-jobs
Don't backup / restore job definitions
--exclude-hosts
Don't backup / restore .ssh/known_hosts file
--include-logs
Include execution logs in the backup / restore procedure (they are excluded by default)
-c | --configdir
Change default rundeck config directory (/etc/rundeck)
-u | --user
Change default rundeck user (rundeck)
-s | --service

I've done my best (and the best I felt like :P), so there is probably room for improvements. I long for critics and suggestions to improve it!

Thank you for your attention :)

Tomàs

Tomàs

I'll make something up