mirror of
https://codeberg.org/Sevichecc/forgejo-backup-script.git
synced 2025-04-29 20:59:30 +08:00
Add duplicacy script
This commit is contained in:
parent
d5f6c8a67c
commit
e56c665095
1 changed files with 32 additions and 0 deletions
32
duplicacy.sh
Normal file
32
duplicacy.sh
Normal file
|
@ -0,0 +1,32 @@
|
|||
#!/usr/bin/expect
|
||||
set ACCESS_KEY_ID "YOUR_ACCESS_KEY_ID"
|
||||
set SECRET_ACCESS_KEY "YOUR_SECRET_ACCESS_KEY"
|
||||
set PASSWORD "YOUR_PASSWORD"
|
||||
|
||||
set timeout -1
|
||||
|
||||
# Function to handle authentication
|
||||
proc authenticate {} {
|
||||
global ACCESS_KEY_ID SECRET_ACCESS_KEY PASSWORD
|
||||
|
||||
expect "ID"
|
||||
send "$ACCESS_KEY_ID\r"
|
||||
|
||||
expect "Secret"
|
||||
send "$SECRET_ACCESS_KEY\r"
|
||||
|
||||
expect "password"
|
||||
send "$PASSWORD\r"
|
||||
}
|
||||
|
||||
# Run duplicacy backup command
|
||||
spawn duplicacy backup -threads 4
|
||||
authenticate
|
||||
expect "completed"
|
||||
|
||||
# Run duplicacy prune command (optional)
|
||||
spawn duplicacy prune -keep 7:30
|
||||
authenticate
|
||||
|
||||
# Allow user interaction after script completion
|
||||
interact
|
Loading…
Reference in a new issue