From 232c814b851a2da2d1b2c03ced671c7e3ce6d480 Mon Sep 17 00:00:00 2001 From: DecaTec Date: Thu, 11 Mar 2021 08:36:32 +0100 Subject: [PATCH 1/1] Added info about calling script by cron --- README.md | 4 ++++ 1 file changed, 4 insertions(+) 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*. -- 2.34.1