-
Notifications
You must be signed in to change notification settings - Fork 0
/
upd.sh
executable file
·22 lines (18 loc) · 1.11 KB
/
upd.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/bash
UPDFILE=/var/log/billing/update.log
DBFILE=/var/log/billing/check_db.log
message="$(date +"%y-%m-%d %T")"
echo "====================================================">>$UPDFILE
echo $message " - Обновление запущено" >>$UPDFILE
echo "====================================================">>$UPDFILE
(cd /usr/axbills && /usr/bin/git stash >>$UPDFILE 2>&1)
(cd /usr/axbills && /usr/bin/git stash drop >>$UPDFILE 2>&1)
(cd /usr/axbills && /usr/bin/git pull >>$UPDFILE 2>&1)
echo "====================================================">>$UPDFILE
echo $message " - Обновление закончилось" >>$UPDFILE
echo "====================================================">>$DBFILE
echo $message " - начали проверку базы данных">>$DBFILE
echo "====================================================">>$DBFILE
(cd /usr/axbills/misc && /usr/axbills/misc/db_check/db_check.pl CREATE_NOT_EXIST_TABLES APPLY_ALL=1 >>$DBFILE 2>&1)
echo "====================================================">>$DBFILE
echo $message " - проверка базы данных завершена">>$DBFILE