gcgarner / IOTstack

docker stack for getting started on IOT on the Raspberry PI
GNU General Public License v3.0
1.5k stars 578 forks source link

auto backup by crontab not working #189

Open hasanbasri1993 opened 4 years ago

hasanbasri1993 commented 4 years ago

OS: Ubntu 1604 gcloud

i set a crontab like this */1 * * * * ~/IOTstack/scripts/docker_backup.sh > cron.log

but not working

webadmin@instance-1:~$ cat cron.log 
compressing stack folders
backup saved to ./backups/backup-2020-05-20_0448.tar.gz
last seven local backup files are saved in ~/IOTstack/backups

when run teriminal

webadmin@instance-1:~$ ~/IOTstack/scripts/docker_backup.sh > cron.log
webadmin@instance-1:~$ cat cron.log 
~/IOTstack ~
Moving old influxdb backups if they exist
backing up influxdb database
influxdb backup complete
compressing stack folders
backup saved to ./backups/backup-2020-05-20_0451.tar.gz
9.8M    ./backups/backup-2020-05-20_0451.tar.gz
last seven local backup files are saved in ~/IOTstack/backups
uploading to dropbox
 > Uploading "/home/webadmin/IOTstack/backups/backup-2020-05-20_0451.tar.gz" to "/backup-2020-05-20_0451.tar.gz"... DONE
checking for old backups on dropbox
deleting old backups from dropbox if they exist - last 7 files are kept
~ 

thanks u

andreas5012 commented 4 years ago

To find the error, add 2>&1 at the end of the crontab commandline. Now you can see the error messages in log too.