Best way to automate Rundeck backups

2,177 views
Skip to first unread message

Russell Jones

unread,
Sep 23, 2014, 3:29:34 PM9/23/14
to rundeck...@googlegroups.com
What would be considered best practice for automatically backing up all projects/jobs? I see the backup documents have you exporting individual jobs and copying some data folders over. Can you export entire projects from the CLI? What would still be missing from a project backup that would need to be accounted for?


Thanks!

Daniel Serodio

unread,
Sep 29, 2014, 6:26:03 PM9/29/14
to rundeck...@googlegroups.com
I'm also looking to automate Rundeck backup, and I don't quite follow: if Rundeck's data is stored in a database, why do I need to run rd-jobs instead of only backing up the database?

Also, how do I specify how rd-jobs will authenticate? It's currently failing because it can't authenticate the "admin" user.

Thanks in advance,
Daniel Serodio

n8mo...@gmail.com

unread,
Sep 30, 2014, 2:02:24 PM9/30/14
to rundeck...@googlegroups.com
http://rundeck.org/docs/administration/backup-and-recovery.html

Jobs are stored on the file system as xml files therefore a database backup is insufficient.

In summary of the docs above you need database backup, jobs backup (I use the API to dump the jobs to a file) and rundeck home directory backup.  Logs too if you need them audits. 
I set this all up with cron/mysqlbackup (https://code.google.com/p/mysqlbackup/) which automatically trims, encrypts and compresses backups.

I've never shutdown rundeck to perform a backup and haven't had trouble but YMMV. 

Daniel Serodio

unread,
Sep 30, 2014, 2:40:35 PM9/30/14
to rundeck...@googlegroups.com
Thanks for the explanation. I believe stopping Rundeck is only needed if using the embedded H2 database.

Where are the XML files containing the jobs stored? The only XML files I see in /var/rundeck are the projects' etc/resources.xml, which don't contain the jobs

I can't use `rd-jobs` to dump the projects' jobs because it's trying to authenticate using the 'admin' user, and it fails:

$ rd-jobs -p test_project
ERROR BaseFormAuthenticator: Form-based auth failed
Error: Error making server request to http://rundeck.intranet:4440: Unable to authenticate user: admin

It seems rd-jobs use hardcoded admin/admin credentials. Do you think you can share the script you're using to dump the jobs to a file?

Regards,
Daniel Serodio

HAPS

unread,
Oct 1, 2014, 10:30:22 PM10/1/14
to rundeck...@googlegroups.com
I'm having the same issue with authentication.  Trying password.

curl -v -H "Content-Type: application/json" -X POST -d '{ "j_username" : "admin" , "admin" : "thepassword" }' http://rundeck_box:4440/j_security_check

> { "j_username" : "admin" , "admin" : "thepassword" }HTTP/1.1 302 Found
< Set-Cookie: JSESSIONID=ez2w50lxrayryawh54ltz9x;Path=/
< Expires: Thu, 01 Jan 1970 00:00:00 GMT
< Location: http://rundeck_box:4440/user/error;jsessionid=ez2w50lxrayryawh54ltz9x

It has the same basic problem when I change curl to curl -L.  I get the 200, but it says Invalid username and password.

The framework.properties file has:

framework.server.username = admin
framework.server.password = thepassword



On Tuesday, September 23, 2014 3:29:34 PM UTC-4, Russell Jones wrote:

HAPS

unread,
Oct 3, 2014, 3:05:49 PM10/3/14
to rundeck...@googlegroups.com
This is strange, but it turns out that even though the page says that incorrect username/pass, running rd-jobs works just fine.

Bizarre.
Reply all
Reply to author
Forward
0 new messages