Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # Upgrade jasontest to Evergreen 3.10.0:
- psql -U evergreen -h localhost -d jasontest -f ${HOME}/cwmars-3.7.3-3.10.0-upgrade-db.sql >& $(date %F)-upgrade.log &
- disown -h
- # All of this to set up for next month.
- prog=${0##*/}
- where=${0%$prog}
- y=$(date +%Y)
- m=$(date +%m)
- let m=m+1
- # This should not be necessary after April 2023.
- if [ $m -lt 5 ]; then
- printf -v calarg "%d-%02d" $y $m
- d=$(cal -d $calarg | awk 'NF==7&&NR>2{print $1;exit}')
- printf -v new "%s%d%02d%02d.sh" $where $y $m $d
- mv $0 $new
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement