logging: Check if typescripts with a similar name already exist
[sunny256-utils.git] / fra_linode
blobed2445e17bd536f93747e2006e31df624f7e5c7b
1 #!/usr/bin/env bash
3 # File ID: 30375978-63a4-11e0-9d08-00023faf1383
5 progname=fra_linode
6 test -e /bellmann.mrk || { echo $progname: Skal kjøres på bellmann. >&2; exit 1; }
7 lockdir=~/.fra_linode.LOCK
9 myexit() {
10 rmdir $lockdir || echo $progname: $lockdir: Cannot remove lockdir >&2
11 exit $1
14 trap "myexit 1" INT TERM
15 mkdir $lockdir || {
16 echo $progname: Ser ut som det kjører en allerede, klarte ikke å mekke lockdir $lockdir >&2;
17 exit 1;
20 unset bw
21 test -z "$1" || bw=" --bwlimit=$1"
22 echo bw = \"$bw\"
24 until rsync -avzP$bw --timeout=120 sunny@sunbase.org:dl/til_bellmann/ ~/dl/fra_linode/; do
25 echo $progname: rsync failed, retrying...
26 sleep 2
27 done
28 rmdir $lockdir