summaryrefslogtreecommitdiff
path: root/libexecs/remove-lorry-controller-from-lorry-crontab
blob: 8fc6cf31edd4e90b2dda383d0ab2d680057e3a92 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh
#
# Trove used to run a version of Lorry Controller that wasn't a
# daemon, but instead was invoked once a minute from a crontab owned
# by the lorry user. When we upgrade to a version of Lorry Controller
# that does run as a daemon, we need to disable the cronjob. This
# script does that.
#
# The lorry user crontab may contain other jobs, so we can't just
# willy-nilly delete the whole crontab. Instead, we remove the
# specific line. The line looks like this:
#
#     */1 * * * * flock -x -n /home/lorry/lorry-controller-area/lockfile
#     -c lorry-controller --work-area=/home/lorry/lorry-controller-area 
#     --log=syslog --log-level=info --html-file=/home/lorry/lc-status.html
#
# Except, of course, all on one line.


crontab -l |
grep -v -e '-c lorry-controller' |
crontab -