Initial commit
This commit is contained in:
commit
968d09e362
88 changed files with 2323 additions and 0 deletions
25
contestops/backup-create.sh
Executable file
25
contestops/backup-create.sh
Executable file
|
|
@ -0,0 +1,25 @@
|
|||
#!/bin/bash
|
||||
|
||||
sleep_secs=120
|
||||
|
||||
do_backup() {
|
||||
for host in $(cat hostlist); do
|
||||
echo $host
|
||||
target=backups/$host/$(date --iso-8601=seconds)
|
||||
mkdir -p $target
|
||||
rsync -e "ssh -F local.ssh_config" --recursive --links --perms --times --verbose --prune-empty-dirs --exclude ".*" --exclude "/snap" --exclude "Screenshot from *" --max-size 200K $host:/home/contestant/ $target
|
||||
done
|
||||
}
|
||||
|
||||
if [ "$1" == timer ]; then
|
||||
while true; do
|
||||
do_backup
|
||||
echo
|
||||
echo "Finished, next backup in $sleep_secs seconds."
|
||||
echo
|
||||
echo
|
||||
sleep $sleep_secs
|
||||
done
|
||||
else
|
||||
do_backup
|
||||
fi
|
||||
Loading…
Add table
Add a link
Reference in a new issue