mirror of
https://github.com/Sevichecc/pleroma-backup-script.git
synced 2025-04-30 08:49:31 +08:00
Update backup.sh
This commit is contained in:
parent
12ed8fa53e
commit
c51d0713bd
1 changed files with 32 additions and 0 deletions
32
backup.sh
32
backup.sh
|
@ -14,4 +14,36 @@ cp -r ${PLEROMA_PATH}/uploads ${BACKUP_PATH}
|
|||
echo "3.copy config file"
|
||||
cp ${PLEROMA_CONFIG_PATH} ${BACKUP_PATH}
|
||||
|
||||
echo "————————————upload to remote——————————"
|
||||
echo "4.backup to remote"
|
||||
/usr/bin/expect <<EOF
|
||||
set time 30
|
||||
spawn duplicacy backup -threads 4
|
||||
expect {
|
||||
"ID" { send "$ACCESS_KEY_ID\n"; exp_continue }
|
||||
"Secret" { send "$SECRET_ACCESS_KEY\n"; exp_continue }
|
||||
"password" { send "$PASSWORD\n" }
|
||||
}
|
||||
expect eof
|
||||
EOF
|
||||
|
||||
echo `date +"%Y-%m-%d %H:%M:%S"` " done!"
|
||||
|
||||
# 5. (optional)Keep a revision every 7 days for revisions older than 30 days
|
||||
# echo "5.prune snapshot"
|
||||
# /usr/bin/expect <<EOF
|
||||
# set time 30
|
||||
# spawn duplicacy backup -threads 4
|
||||
# expect {
|
||||
# "ID" { send "$ACCESS_KEY_ID\n"; exp_continue }
|
||||
# "Secret" { send "$SECRET_ACCESS_KEY\n"; exp_continue }
|
||||
# "password" { send "$PASSWORD\n" }
|
||||
# }
|
||||
# spawn duplicacy prune -keep 7:30
|
||||
# expect {
|
||||
# "ID" { send "$ACCESS_KEY_ID\n"; exp_continue }
|
||||
# "Secret" { send "$SECRET_ACCESS_KEY\n"; exp_continue }
|
||||
# "password" { send "$PASSWORD\n" }
|
||||
# }
|
||||
# expect eof
|
||||
# EOF
|
||||
|
|
Loading…
Reference in a new issue