mirror of
https://github.com/guezoloic/serverconfig.git
synced 2026-01-25 09:34:23 +00:00
feat: add isUpdated and cron error statement
- isUpdated (create_env_variable common.sh) to not propose overwrite field - if cron does not exist, print error (log too)
This commit is contained in:
@@ -22,8 +22,8 @@ if [[ "--install" == $INSTALLED ]]; then
|
||||
info_print "AWS configuration."
|
||||
aws configure
|
||||
|
||||
create_env_variable AWS_ACCESS_KEY_ID $(aws configure get aws_access_key_id)
|
||||
create_env_variable AWS_SECRET_ACCESS_KEY $(aws configure get aws_secret_access_key)
|
||||
create_env_variable AWS_ACCESS_KEY_ID $(aws configure get aws_access_key_id) -- false
|
||||
create_env_variable AWS_SECRET_ACCESS_KEY $(aws configure get aws_secret_access_key) -- false
|
||||
|
||||
touch "$BACKUP"
|
||||
info_print "$BACKUP created."
|
||||
@@ -35,6 +35,11 @@ if [[ "--install" == $INSTALLED ]]; then
|
||||
done
|
||||
info_print "You can add more names later by editing $BACKUP."
|
||||
|
||||
if ! command -v crontab >/dev/null 2>&1; then
|
||||
info_print "Error: crontab not found." $ERROR_FLAG
|
||||
exit 1
|
||||
fi
|
||||
|
||||
CRON_JOB="0 0 * * * $SCRIPT_FILE/scripts/aws-backup.sh"
|
||||
crontab -l | grep -F "$CRON_JOB" > /dev/null 2>&1
|
||||
if ! crontab -l | grep -Fq "$CRON_JOB"; then
|
||||
|
||||
Reference in New Issue
Block a user