Skip to content

armgit / core

Public Imported from GitHub
0

100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps

Minor

Rich Turnereddc192f9cb2
diff --git a/.ci_cd/aws/cloudformation-create-ec2.yml b/.ci_cd/aws/cloudformation-create-ec2.yml
index 940bc9cc4..d1da96ecc 100644
--- a/.ci_cd/aws/cloudformation-create-ec2.yml
+++ b/.ci_cd/aws/cloudformation-create-ec2.yml
@@ -216,7 +216,7 @@ Resources:
[Service]
Type=oneshot
- RandomizedDelaySec=30min
+ RandomizedDelaySec=1800
ExecStart=/usr/local/bin/s3-backup
[Install]
diff --git a/.ci_cd/host_init/init.sh b/.ci_cd/host_init/init.sh
index 1830a0840..ba7ffa08c 100644
--- a/.ci_cd/host_init/init.sh
+++ b/.ci_cd/host_init/init.sh
@@ -43,11 +43,13 @@ if [ "$DAILY_BACKUP" != 'false' ]; then
username=$(id -u -n)
if [ -n "$SUDO_USER" ]; then
- username=$SUDO_USER
+ dir=$(eval echo "~$SUDO_USER")
+ else
+ dir=~
fi
- dir=~
+
echo '#!/bin/bash' > /etc/cron.d/or-backup
- echo "0 4 * * * $username $dir/temp/host_init/backup.sh" >> /etc/cron.d/or-backup
+ echo "0 4 * * * root $dir/temp/host_init/backup.sh" >> /etc/cron.d/or-backup
else
echo "Removing any existing daily backup cron job"
rm -f /etc/cron.d/or-backup &>/dev/null