]> git.p6c8.net - nextcloud-backup-restore.git/commitdiff
Merge pull request 'Added configuration option "ignoreUpdaterBackups"' (#13) from...
authorDecaTec <decatec@noreply.codeberg.org>
Tue, 18 Feb 2020 06:56:15 +0000 (07:56 +0100)
committerDecaTec <decatec@noreply.codeberg.org>
Tue, 18 Feb 2020 06:56:15 +0000 (07:56 +0100)
NextcloudBackup.sh

index 6781eafc947a265569a203bb59f32a6921f211a9..ce9601a84107921fa33ebb799f600669e8e27435 100644 (file)
@@ -65,6 +65,10 @@ dbPassword='mYpAsSw0rd'
 # TODO: The maximum number of backups to keep (when set to 0, all backups are kept)
 maxNrOfBackups=0
 
+# TODO: Ignore updater's backup directory in the data directory to safe space
+# Set to true to ignore the backup directory
+ignoreUpdaterBackups=false
+
 # File names for backup files
 # If you prefer other file names, you'll also have to change the NextcloudRestore.sh script.
 fileNameBackupFileDir='nextcloud-filedir.tar.gz'
@@ -150,7 +154,14 @@ echo
 # Backup data directory
 #
 echo "Creating backup of Nextcloud data directory..."
-tar -cpzf "${backupdir}/${fileNameBackupDataDir}"  -C "${nextcloudDataDir}" .
+
+if [ "$ignoreUpdaterBackups" = true ] ; then
+        echo "Ignoring updater backup directory"
+        tar -cpzf "${backupdir}/${fileNameBackupDataDir}"  --exclude="updater-*/backups/*" -C "${nextcloudDataDir}" .
+else
+        tar -cpzf "${backupdir}/${fileNameBackupDataDir}"  -C "${nextcloudDataDir}" .
+fi
+
 echo "Done"
 echo
 
@@ -224,4 +235,4 @@ fi
 
 echo
 echo "DONE!"
-echo "Backup created: ${backupdir}"
\ No newline at end of file
+echo "Backup created: ${backupdir}"

patrick-canterino.de