-
Notifications
You must be signed in to change notification settings - Fork 1
/
run.sh
executable file
·45 lines (37 loc) · 1008 Bytes
/
run.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/bash
source /etc/profile
set -ev
export TZ='Asia/Shanghai'
folder="json_data"
if [[ -d ${folder} ]]; then
rm -rf ${folder}
fi
if [[ ! -d ${folder} ]]; then
mkdir ${folder}
fi
python3 task_daily.py ${access_key}
cd ..
folder="bilibili_splash_fetch_data"
if [[ -d ${folder} ]]; then
rm -rf ${folder}
fi
git clone "https://github.com/yuangezhizao/bilibili_splash_fetch_data.git" bilibili_splash_fetch_data
cd bilibili_splash_fetch_data
folder="raw"
if [[ ! -d ${folder} ]]; then
mkdir ${folder}
fi
folder="hourly"
if [[ ! -d ${folder} ]]; then
mkdir ${folder}
fi
cd ..
cp -r bilibili_splash_fetch/json_data/. bilibili_splash_fetch_data/raw
cd bilibili_splash_fetch
python3 hourly.py
cd ../bilibili_splash_fetch_data
git config user.name "yuangezhizao-serveraccount"
git config user.email "yuangezhizao@gmail.com"
git add .
git commit -m "CentOS Server Cron Jobs at `date +"%Y-%m-%d %H:%M:%S"`"
git push "https://${TravisCIToken}@github.com/yuangezhizao/bilibili_splash_fetch_data.git"