-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcron-daily
More file actions
executable file
·46 lines (34 loc) · 850 Bytes
/
cron-daily
File metadata and controls
executable file
·46 lines (34 loc) · 850 Bytes
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
46
#!/bin/bash
FIRST=1
function header()
{
[ ${FIRST} -eq 1 ] && FIRST=0 || echo
echo "-- $(date -R)"
echo "-- ${*}"
}
function footer()
{
echo "-- Done"
echo "-- $(date -R)"
}
if [ "$(id -u)" -eq 0 ] ; then
exec sudo -u juergh "$0"
fi
d=/home/juergh/git/cron
log=${d}/cron-daily.log
mv "${log}".2 "${log}".3
mv "${log}".1 "${log}".2
mv "${log}" "${log}".1
{
# shellcheck disable=SC2155
export SSH_AUTH_SOCK=/run/user/$(id -u)/keyring/ssh
header "Run git-update daily"
"${d}"/tools/git-update daily "${d}"
header "Run linux-fixes"
"${d}"/tools/linux-fixes --verbose "${d}"/linux-fixes.json.gz add "${d}"/linux.git master
header "Run cranky-update-sessions"
"${d}"/tools/cranky-update-sessions
header "Run git-fetch-linux-ubuntu"
( cd "${d}"/linux-ubuntu.git && "${d}"/tools/git-fetch-linux-ubuntu )
footer
} > "${log}" 2>&1