Added immich backup script and mounting script
This commit is contained in:
parent
265202c15d
commit
94b893530d
1
.gitignore
vendored
1
.gitignore
vendored
@ -1 +1,2 @@
|
||||
account
|
||||
bucket
|
||||
|
32
backup.sh
Normal file
32
backup.sh
Normal file
@ -0,0 +1,32 @@
|
||||
#!/bin/bash
|
||||
source ./account
|
||||
source ./bucket
|
||||
|
||||
FOLDER="/home/drudoo/Pi2/immich"
|
||||
|
||||
EXCLUDE='lost+found'
|
||||
|
||||
if pidof -x restic > /dev/null; then
|
||||
echo "Restic backup is already running"
|
||||
exit
|
||||
else
|
||||
echo "Starting backup: $FOLDER to $RESTIC_BUCKET"
|
||||
fi
|
||||
|
||||
|
||||
if mount | grep /home/drudoo/Pi2 > /dev/null; then
|
||||
echo "Mount exists"
|
||||
else
|
||||
exit
|
||||
fi
|
||||
|
||||
|
||||
restic -v -r b2:$RESTIC_BUCKET backup $FOLDER -o b2.connections=50
|
||||
|
||||
day=$(date +"%u")
|
||||
if [[ day -eq 5 ]]; then
|
||||
echo "Deleting old backups"
|
||||
restic -r b2:$RESTIC_BUCKET forget --keep-daily 7 --keep-weekly 4 --keep-monthly 6 --keep-yearly 2 --prune
|
||||
restic -r b2:$RESTIC_BUCKET check
|
||||
fi
|
||||
|
12
mountBackblaze.sh
Normal file
12
mountBackblaze.sh
Normal file
@ -0,0 +1,12 @@
|
||||
#!/bin/bash
|
||||
source ./account
|
||||
source ./bucket
|
||||
|
||||
FOLDER='restic_mount'
|
||||
|
||||
# EDIT ABOVE
|
||||
|
||||
|
||||
echo 'Mounting '$RESTIC_BUCKET
|
||||
|
||||
restic mount -r b2:$RESTIC_BUCKET /home/drudoo/$FOLDER
|
Loading…
Reference in New Issue
Block a user