Posted to tcl by funa at Wed Dec 11 12:54:09 GMT 2019view raw
- #!/usr/local/expect
- set DATE [exec date +%Y-%m-%d]
- spawn /usr/local/archive.sh archive $DATE /backup/archive
- expect
- if [[ "Archive all revisions received until $DATE? (yes/no):" ]];then {
- send -- "yes"
- else
- exit 0
- }
- expect eof
- Output:
- ./archive
- spawn /usr/local/st_archive.sh archive 2019-12-11 /backup/archive/
- Preparing...
- Date specified is too late. Last revision in the database is from 2019-11-14.
- Archiving revisions failed or aborted.
- invalid command name "Archive"
- while executing
- "Archive all revisions received until $DATE? (yes/no): "
- invoked from within
- "[ Archive all revisions received until $DATE? (yes/no): ]"
- invoked from within
- "if [[ Archive all revisions received until $DATE? (yes/no): ]]"
- (file "./archive" line 5)