forked from Myceliandre/myc-manage
Browse Source
new: [vps] common backup process between ``mailcow`` and ``compose`` installs
new: [vps] common backup process between ``mailcow`` and ``compose`` installs
Signed-off-by: Valentin Lab <valentin.lab@kalysto.org>rc1
Valentin Lab
4 years ago
3 changed files with 163 additions and 77 deletions
-
85README.org
-
30bin/myc-check-and-launch-backup
-
125bin/vps
@ -1,30 +0,0 @@ |
|||||
#!/bin/bash |
|
||||
|
|
||||
## |
|
||||
## Quick and dirty check launching backup |
|
||||
## |
|
||||
|
|
||||
if ! cron_line=$(docker exec myc_cron_1 cat /etc/cron.d/rsync-backup | grep "\* \* \*"); then |
|
||||
echo "can't find cron_line in cron container." >&2 |
|
||||
exit 1 |
|
||||
fi |
|
||||
|
|
||||
cron_line=${cron_line%|*} |
|
||||
cron_line=${cron_line%"2>&1"*} |
|
||||
|
|
||||
cmd_line="${cron_line#*root}" |
|
||||
|
|
||||
eval "args=($cmd_line)" |
|
||||
|
|
||||
## should be last argument |
|
||||
|
|
||||
docker_cmd=$(echo ${args[@]: -1}) |
|
||||
|
|
||||
if ! [[ "$docker_cmd" == "docker run --rm -e "* ]]; then |
|
||||
echo "docker command found should start with 'docker run'." >&2 |
|
||||
echo "Here's command:" >&2 |
|
||||
echo " $docker_cmd" >&2 |
|
||||
exit 1 |
|
||||
fi |
|
||||
|
|
||||
eval "docker exec -i myc_cron_1 $docker_cmd" |
|
Write
Preview
Loading…
Cancel
Save
Reference in new issue