Adjustments to ease scripted 'automatic' backup
Is your feature request related to a problem? Please describe. I am trying to set up "automatic"/"part-db supported" (as per instructions here) using cron to make them automatically recurring, but I am running into one of 2 problems:
- Running
sudo -u www-data php bin/console partdb:backupgives me the following permission issue:
I am able to create files and directories as www-data to my backup directory, so maybe the parent process that is making this fopen() call isn't running as www-data? I've granted rwx permissions for the backup directory to user/group/other. Maybe this could be considered a bug by itself? Or quite possibly it could be user error as I am not an export on this stuff.
- Trying to workaround this by running as root:
sudo php bin/console partdb:backupgives me the dialog asking me to confirm that I want to continue given the risk of causing permission problems. I don't really want to have to deal with automating a script that has to parse the output of the backup program... I tried running with the--no-interactionflag, but it just causes the backup to abort.
Describe the solution you'd like It would be nice if there was an easy way to schedule recurring automatic (Part DB supported) backups.
Describe alternatives you've considered Writing, this it looks like I can probably do what I need by automating the 'manual' backup process, so apologies if this is superfluous. I thought I might post anyways in case it's desired to simplify this somehow, or there is some obvious workaround I am missing.
By default the user www-data can not write anywhere but in /var/www/.
You could create the backup somewhere in there, then move it where you want it using your user account.
Example cronjob:
sudo -u www-data php bin/console partdb:backup --full /var/www/partdb/backup.zip && mv /var/www/partdb/backup.zip ~/partdb_$(date -I).zip