Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # run this on the command line of the ubiquiti device
- # cd /etc/persistent/; mkdir etc; mkdir etc/crontabs; wget -O cron-install.sh http://pastebin.com/raw/64X6hrvX; chmod +x ./cron-install.sh; ./cron-install.sh
- #
- cat << EOF > rc.prestart
- #!/bin/sh
- #
- # /etc/persistent/rc.prestart
- #
- ## add crond to the start up list
- CROND=`grep crond /etc/startup.list | cut -d= -f2` if [ ${CROND} ]; then
- :
- else
- echo 'crond' >> /etc/startup.list fi
- # add crond to the /etc/sysinit directory
- if [ -e /etc/sysinit/crond.conf ];then
- :
- else
- cp /etc/persistent/etc/crond.conf /etc/sysinit/crond.conf fi
- # link /etc/crontabs to /etc/persistent/etc/crontabs
- if [ -e /etc/crontabs ]; then
- :
- else
- ln -s /etc/persistent/etc/crontabs /etc/crontabs fi
- EOF
- cat << EOF > etc/crond.conf
- #!/bin/sh /etc/rc.common
- #
- # BusyBox v1.11.2 (2012-08-16 13:34:40 EEST) multi-call binary Usage: crond -fbS -l N -L LOGFILE -c DIR
- # -f Foreground -b Background (default) -S Log to syslog (default) -l Set log level. 0 is the most verbose, default 8 -L Log to file -c Working dir
- #
- # ------------------ do not edit below this line ------------------
- plugin_start() {
- /usr/bin/crond
- true
- }
- plugin_stop() {
- kill `pidof crond`
- true
- }
- EOF
- cat << EOF > etc/crontabs/$USER
- #
- # /etc/persistent/etc/crontabs/ubnt This is the ubnt user's crontab
- #
- # File Format field values +----------------------------------- minute 0-59
- # | +------------------------------ hour 0-23
- # | | +------------------------- day of month 1-31
- # | | | +-------------------- month 1-12
- # | | | | +--------------- weekday 0-6
- # | | | | | +---------- command
- # | | | | | |
- # */5 * * * * /do/something/here
- EOF
- save
- /usr/etc/init.d/plugin stop crond &&/usr/etc/init.d/plugin start crond
- chmod +x /etc/persistent/etc/rc.prestart
- cp /etc/persistent/etc/crontabs/ubnt /etc/persistent/etc/crontabs/$USER
- ./rc.prestart
- crontab -l
- ps | grep cron
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement