From: DecaTec Date: Thu, 11 Mar 2021 07:36:32 +0000 (+0100) Subject: Added info about calling script by cron X-Git-Tag: v2.1.1~1 X-Git-Url: https://git.p6c8.net/nextcloud-backup-restore.git/commitdiff_plain/232c814b851a2da2d1b2c03ced671c7e3ce6d480 Added info about calling script by cron --- diff --git a/README.md b/README.md index 54681bf..a1f5413 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,10 @@ In order to create a backup, simply call the script *NextcloudBackup.sh* on your If this script is called without parameter, the backup is saved in a directory with the current time stamp in your main backup directory: As an example, this would be */media/hdd/nextcloud_backup/20170910_132703*. The backup script can also be called with a parameter specifiying the main backup directory, e.g. *./NextcloudBackup.sh /media/hdd/nextcloud_backup*. In this case, the directory specified will be used as main backup directory. +You can also call this script by cron. Example (at 2am every night, with log output): + +`0 2 * * * /path/to/scripts/Nextcloud-Backup-Restore/NextcloudBackup.sh > /path/to/logs/Nextcloud-Backup-$(date +\%Y\%m\%d\%H\%M\%S).log 2>&1` + ## Restore For restore, just call *NextcloudRestore.sh*. This script expects at least one parameter specifying the name of the backup to be restored. In our example, this would be *20170910_132703* (the time stamp of the backup created before). The full command for a restore would be *./NextcloudRestore.sh 20170910_132703*.