Skip to content

Commit

Permalink
nc-backup-auto: notify failures
Browse files Browse the repository at this point in the history
  • Loading branch information
nachoparker committed Feb 17, 2019
1 parent 743cb24 commit 41a48c9
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
8 changes: 5 additions & 3 deletions bin/ncp/BACKUPS/nc-backup-auto.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@ configure()

cat > /usr/local/bin/ncp-backup-auto <<EOF
#!/bin/bash
sudo -u www-data php /var/www/nextcloud/occ maintenance:mode --on
/usr/local/bin/ncp-backup "$DESTDIR" "$INCLUDEDATA" "$COMPRESS" "$BACKUPLIMIT"
sudo -u www-data php /var/www/nextcloud/occ maintenance:mode --off
ncc maintenance:mode --on
/usr/local/bin/ncp-backup "$DESTDIR" "$INCLUDEDATA" "$COMPRESS" "$BACKUPLIMIT" || failed=true
ncc maintenance:mode --off
[[ "\$failed" == "true" ]] && \
ncc notification:generate "$NOTIFYUSER" "Auto-backup failed" -l "Your automatic backup failed"
EOF
chmod +x /usr/local/bin/ncp-backup-auto

Expand Down
4 changes: 3 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@

[v1.6.6](https://github.com/nextcloud/nextcloudpi/commit/93cc781) (2019-02-15) nc-automount: fix NFS delay
[v1.6.7](https://github.com/nextcloud/nextcloudpi/commit/3bcccdd) (2019-02-17) nc-backup-auto: notify failures

[v1.6.6](https://github.com/nextcloud/nextcloudpi/commit/743cb24) (2019-02-15) nc-automount: fix NFS delay

[v1.6.5 ](https://github.com/nextcloud/nextcloudpi/commit/c28868d) (2019-02-15) nc-trusted-domains: empty values by default

Expand Down
6 changes: 6 additions & 0 deletions etc/ncp-config.d/nc-backup-auto.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@
"name": "Backup limit",
"suggest": "4",
"value": "4"
},
{
"id": "NOTIFYUSER",
"name": "Notify user",
"suggest": "ncp",
"value": "ncp"
}
]
}

0 comments on commit 41a48c9

Please sign in to comment.