Compare commits
No commits in common. "b408af06a56afb1a34eb0de21a9ed4f9934c9540" and "a1ee59ba09d18b7e0817a91875645c8fcd4fe3db" have entirely different histories.
b408af06a5
...
a1ee59ba09
4 changed files with 1 additions and 28 deletions
|
@ -28,6 +28,7 @@ info "Starting backup"
|
||||||
--exclude 'var/cache/*' \
|
--exclude 'var/cache/*' \
|
||||||
--exclude 'srv/data/backup' \
|
--exclude 'srv/data/backup' \
|
||||||
--exclude '*/.Trash*' \
|
--exclude '*/.Trash*' \
|
||||||
|
--exclude '*/Trash*' \
|
||||||
\
|
\
|
||||||
::'{hostname}-{now}' \
|
::'{hostname}-{now}' \
|
||||||
/etc \
|
/etc \
|
|
@ -1,25 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
export BORG_PASSPHRASE="$(cat /root/secret/borg-snowboard.key)"
|
|
||||||
if [[ -z "${BORG_PASSPHRASE}" ]]; then
|
|
||||||
echo 'BORG_PASSPHRASE is not set, cannot continue'
|
|
||||||
exit
|
|
||||||
fi
|
|
||||||
cd /srv/data/backup/borg/snowboard
|
|
||||||
mkdir -p old
|
|
||||||
mv data* old
|
|
||||||
backupdir="data-$(date -I)"
|
|
||||||
mkdir -p $backupdir
|
|
||||||
cd $backupdir
|
|
||||||
sftp fileserver@cscherr.de < /usr/local/cron/scripts/sftp-commands.txt
|
|
||||||
status_download=$?
|
|
||||||
echo "finished downloading from snowboard. Status: $status_download"
|
|
||||||
borg check -v data/backup/borg/snowboard
|
|
||||||
status_check=$?
|
|
||||||
echo "finished checking the downloaded repo. Status: $status_check"
|
|
||||||
if [ "$status_check" -eq "0" ]; then
|
|
||||||
cd /srv/data/backup/borg/snowboard
|
|
||||||
rm -r old
|
|
||||||
else
|
|
||||||
echo "the new repo was not checked successfully, keeping old repo."
|
|
||||||
fi
|
|
||||||
echo $(date +"%Y-%m-%dT%H:%M:%S%z")
|
|
|
@ -1,3 +0,0 @@
|
||||||
# get all files and directories in /data
|
|
||||||
# /data is the main dir. / is only a gateway dir with a bind mount
|
|
||||||
get -R /data
|
|
Loading…
Add table
Reference in a new issue