diff --git a/compress_qcow2_file.sh b/compress_qcow2_file.sh index f75fc8d..5d28173 100755 --- a/compress_qcow2_file.sh +++ b/compress_qcow2_file.sh @@ -1,5 +1,12 @@ #!/bin/bash +# ============ R e q u i r e s package guestfs-tools + +if [ "$(id -u)" -ne 0 ]; then + echo "This script must be run as root." >&2 + exit 1 +fi + # ------ Settings TmpDir=/localdisk/tmp diff --git a/crontab.txt b/crontab.txt index e69de29..05b92a7 100644 --- a/crontab.txt +++ b/crontab.txt @@ -0,0 +1,3 @@ +23 23 * * * /works/utils/archive_logs.sh -L /works/logs -A /works/archive/logs -D "1 day ago" 2>&1 | /usr/bin/ts '[\%Y-\%m-\%d \%H:\%M:\%S]' >> /works/logs/$(date +\%Y\%m\%d).archive_logs.works.log +33 23 * * * /works/utils/archive_logs.sh -L /works/docker/daily_mktdata/logs -A /works/archive/logs -D "1 day ago" 2>&1 | /usr/bin/ts '[\%Y-\%m-\%d \%H:\%M:\%S]' >> /works/logs/$(date +\%Y\%m\%d).archive_logs.daily_mktdata.log +10 1 * * * /works/utils/move_archives.sh -H cvtt_md -A /works/archive -D "1 day ago" 2>&1 | /usr/bin/ts '[\%Y-\%m-\%d \%H:\%M:\%S]' >> /works/logs/$(date +\%Y\%m\%d).move_archives.log diff --git a/crontab_root.txt b/crontab_root.txt index e69de29..bb042a8 100644 --- a/crontab_root.txt +++ b/crontab_root.txt @@ -0,0 +1,8 @@ +#=========================================================================== +# -------- T e s t +# -------- T e s t +#=========================================================================== +10 0 * * * /works/admin/compress_qcow2.sh 2>&1 | /usr/bin/ts '[\%Y-\%m-\%d \%H:\%M:\%S]' >> /works/logs/$(date +\%Y\%m\%d).backup_vm.compress_qcow2.log 2>&1 +### +* * * * * chown -R oleg:oleg /works 2>&1 +#