... | @@ -67,8 +67,7 @@ Add these commands in a new file under /etc/sudoers.d/ |
... | @@ -67,8 +67,7 @@ Add these commands in a new file under /etc/sudoers.d/ |
|
|
|
|
|
https://www.cyberciti.biz/faq/linux-unix-running-sudo-command-without-a-password/
|
|
https://www.cyberciti.biz/faq/linux-unix-running-sudo-command-without-a-password/
|
|
|
|
|
|
### Command to run backups from terminal
|
|
### Backup command
|
|
|
|
|
|
Needs the following parameters:
|
|
Needs the following parameters:
|
|
- path to password file:
|
|
- path to password file:
|
|
PASSWORD="~backupuser/pass"
|
|
PASSWORD="~backupuser/pass"
|
... | @@ -134,6 +133,13 @@ for container in ${STOPPED_CONTAINERS[@]}; do |
... | @@ -134,6 +133,13 @@ for container in ${STOPPED_CONTAINERS[@]}; do |
|
sudo lxc-start $container
|
|
sudo lxc-start $container
|
|
done
|
|
done
|
|
```
|
|
```
|
|
|
|
### Cron job
|
|
|
|
|
|
|
|
As backupuser we add the command in the cron jobs to run once a day (*or anything else it is suitable for the project*)
|
|
|
|
|
|
|
|
`crontab -e`
|
|
|
|
|
|
|
|
`00 04 * * * ./backup.sh 2> ./backup_error.log`
|
|
|
|
|
|
### Resources for backup scripts and helpful tips
|
|
### Resources for backup scripts and helpful tips
|
|
- restic for backups
|
|
- restic for backups
|
... | | ... | |