Debian cron problem

There are 12 replies in this Thread which was already clicked 954 times. The last Post () by Maverick_BK.

  • I think your checkoscam.sh should be something like


    root sh /myfolder/checkoscam.sh (also check the case as its case sensative)


    I am not obligated, or connected to any particular brand, seller or retailer so any opinions given are not biased in anyway.
    Any information given is for hobby and research purposes only, and whilst every effort is made to ensure that all my responses are accurate, - Any action you may take based on my replies is done so at your own risk.
    Viewing Premium Channels or Media, without paying for them is illegal and if you do so, you do so at your own risk!

    BpGgW.jpg



  • Sorry


    */5 * * * * root sh /usr/script/checkoscam.sh


    Do nothing.


    check your 'checkoscam.sh' is the filename completely in lowercase as specified in crontab (Checkoscam.sh and checkoscam.sh, are two different files all together due to case sensitivity)


    I am not obligated, or connected to any particular brand, seller or retailer so any opinions given are not biased in anyway.
    Any information given is for hobby and research purposes only, and whilst every effort is made to ensure that all my responses are accurate, - Any action you may take based on my replies is done so at your own risk.
    Viewing Premium Channels or Media, without paying for them is illegal and if you do so, you do so at your own risk!

    BpGgW.jpg



  • Now i my cron is :


    33 3 * * * root reboot
    */2 * * * * root sh /emu/script/./checkoscam.sh
    00 4 * * * root sh /emu/script/./configupdate.sh >>/emu/log/configupdate.log 2>&1
    10 4 * * * root /emu/script/autoupdate.sh


    now even reboot stop working.???

  • 33 3 * * * /sbin/shutdown -r now


    shutdown -r = reboot


    shutdown resides in /sbin


    cron job needs to be set as root for it to work.


    tbh. no need whatsoever to reboot a linux server, would only schedule a reboot if it was a virtual machine, no need on a standalone machine.


    [edit] You do realise you can use whatever time in cron


    @ 3am /sbin/shutdown -r now


    @ time job date


    Many ways to accomplish what needs to be done :)

  • Debian 6.0.5


    In crontab:
    33 3 * * * root reboot
    */5 * * * * root checkoscam.sh


    Reboot works,checkoscam no(manualy yes).


    there are more than 1 crontab in Debian 6. there is a system crontab in etc/crontab which you access by nano /etc/crontab. It has 5 fields and then user and the command.
    There is lso the user crontab which you access by crontab -e which also has 5 fields followed by command, no user or root. You can find/edit users' crontabs with crontab -u user
    if you "man crontab " there is a lot more info.

  • ps -A | grep cron


    You need to learn/understand more on cron


    Look in /etc and you will see


    cron.daily/weekly/monthly/hourly


    Most jobs are run from scripts, with cron pointing to the script that needs to be run.


    apt-get install chkconfig


    once installed


    chkconfig --list|grep cron

  • On a default installation the cron jobs get logged to


    /var/log/syslog
    You can see just cron jobs in that logfile by running


    grep CRON /var/log/syslog
    If you haven't reconfigured anything,the entries will be in there.


    You can create a cron.log file to contain just the CRON entries that show up in syslog. Note that CRON jobs will still show up in syslog if you follow the following directions.


    Open the file


    nano /etc/rsyslog.d/50-default.conf
    Find the line that starts with:


    #cron.*
    uncomment that line, save the file, and restart rsyslog:


    sudo service rsyslog restart
    You should now see a cron log file here:


    /var/log/cron.log
    Cron activity will now be logged to this file (in addition to syslog).


    Note that in cron.log you will see entries for when cron ran scripts in /etc/cron.hourly, cron.daily, etc. - e.g. something like:


    Apr 12 14:17:01 cd CRON[14368]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
    However, you will not see more information about what scripts were actually ran inside /etc/cron.daily or /etc/cron.hourly, unless those scripts direct output to the cron.log (or perhaps to some other log file).


    If you want to verify if a crontab is running and not have to search for it in cron.log or syslog, create a crontab that redirects output to a log file of your choice - something like:


    01 14 * * * /home/joe/myscript >> /home/log/myscript.log 2>&1
    This will redirect all standard output and errors that may be produced by the script that is run to the log file specified.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!