Initial commit.
This commit is contained in:
27
cron.hourly/0anacron
Executable file
27
cron.hourly/0anacron
Executable file
@@ -0,0 +1,27 @@
|
||||
#!/bin/sh
|
||||
# Check whether 0anacron was run today already
|
||||
if test -r /var/spool/anacron/cron.daily; then
|
||||
day=`cat /var/spool/anacron/cron.daily`
|
||||
fi
|
||||
if [ `date +%Y%m%d` = "$day" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Do not run jobs when on battery power
|
||||
online=1
|
||||
for psupply in AC ADP0 ; do
|
||||
sysfile="/sys/class/power_supply/$psupply/online"
|
||||
|
||||
if [ -f $sysfile ] ; then
|
||||
if [ `cat $sysfile 2>/dev/null`x = 1x ]; then
|
||||
online=1
|
||||
break
|
||||
else
|
||||
online=0
|
||||
fi
|
||||
fi
|
||||
done
|
||||
if [ $online = 0 ]; then
|
||||
exit 0
|
||||
fi
|
||||
/usr/sbin/anacron -s
|
||||
3
cron.hourly/awstats
Executable file
3
cron.hourly/awstats
Executable file
@@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
exec /usr/share/awstats/tools/awstats_updateall.pl now -configdir="/etc/awstats" -awstatsprog="/usr/share/awstats/wwwroot/cgi-bin/awstats.pl" >/dev/null
|
||||
exit 0
|
||||
Reference in New Issue
Block a user