Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Getting automysqlbackup and duplicity to work
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
courage
n00b
n00b


Joined: 22 May 2007
Posts: 38

PostPosted: Wed Jul 12, 2017 6:46 pm    Post subject: Getting automysqlbackup and duplicity to work Reply with quote

Hi!

I'm posting this in case someone faces the same issue and for my self to find the solution in case I forget how I fixed it.
Also it seems that there aren't any problems when not using SELinux (though I could be wrong).

Aside from the usual policy problems (which I fixed by using audit2allow -a and compiling my own policy), there seems to be an issue with cron when using SELinux.
When you launch automysqlbackup and duplicity from command line, it will execute properly, but it won't execute properly from cron, even when running the cronjob as root.

For some reasons when you specify in your /etc/crontab "HOME=/", then the cron daemon will try to find some needed files in "/" not "/root".
For most cronjobs this is not an issue, but duplicity needs to find the PGP key files, which are inside /root/ if you created them as root.
Also if you are using login path instead of plain text login in automysqlbackup, then it will try to locate the .mylogin.cnf file, which is created in /root/, again if you ran mysql_config_editor as root.

Some other cronjobs require to use "HOME=/", so my solution is very simple:
Code:
cp /root/.gnupg /.gnupg -r
cp /root/.mylogin.cnf /.mylogin.cnf
cp /root/.passphrase /.passphrase

Also I changed the duplicity cronjob to the new .passphrase location:
Code:
. /.passphrase
(in /etc/cron.daily/duplicity and /etc/cron.weekly/duplicity.full)


And everything starts working!
Home this helps someone!

If someone has some comments, I would like to hear them, since this might not be the safest nor best solution.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum