19 lines
378 B
Bash
19 lines
378 B
Bash
|
#!/bin/bash
|
||
|
|
||
|
if [ "$(id -u)" != "0" ]; then
|
||
|
echo -e "\033[31mThis script requires superuser rights\033[0m"
|
||
|
exit 0
|
||
|
fi
|
||
|
|
||
|
trap 'echo -e "\033[31mcron.sh: Something went wrong\033[0m"; exit 1' ERR
|
||
|
set -e
|
||
|
|
||
|
export DEBIAN_FRONTEND=noninteractive
|
||
|
|
||
|
cd /data/backup
|
||
|
bash files-all.sh
|
||
|
bash postgres-all.sh
|
||
|
bash mariadb-all.sh
|
||
|
|
||
|
trap - ERR
|
||
|
echo "All cron tasks completed successfully"
|