Created
May 10, 2021 10:53
-
-
Save fmitha/90d0dd3d12b0d357c2864501d8532b2f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://stackoverflow.com/q/20510301/350713 | |
#!/usr/bin/expect -f | |
exp_internal 1 | |
set backupdir "/mnt/db-backups/" | |
set now [clock seconds] | |
set date [clock format $now -format {%Y-%m-%d}] | |
set filename $date | |
append filename "_dbbackups.sql" | |
#exec mysqldump -u root --all-databases --events > $backupdir$filename | |
#spawn zip -e $backupdir$filename.enc.zip $backupdir$filename | |
exec rm -f repo.zip | |
spawn zip -e -r repo.zip repo | |
# expect { | |
# "Enter password: " { send "monkey\r" | |
# exp_continue | |
# } | |
# "Verify password: " {send "monkey\r" | |
# exp_continue | |
# } | |
# } | |
expect "Enter password: " | |
send -- "monkey\r" | |
expect "Verify password: " | |
send -- "monkey\r" | |
exp_continue |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment