Page 17 of 20 FirstFirst ... 71516171819 ... LastLast
Results 161 to 170 of 191

Thread: How-to for crontab

  1. #161
    Join Date
    Dec 2005
    Beans
    135

    Re: How-to for crontab

    Quote Originally Posted by asadqamber View Post
    even when the crontab had:

    * * * * * echo "Print this every minute"
    You'd need to redirect the output from 'echo' to a file if you want to see anything -- echo doesn't run in a particular terminal so you'd never see it otherwise. Try something like

    Code:
     * * * * * /bin/date >> /home/[your user]/test.out
    That should append the current date and time to test.out in your home directory every minute. Let us know if that produces any results

  2. #162
    Join Date
    Jul 2009
    Beans
    9

    Re: How-to for crontab

    Now its working. cheers!

    Thanks for the help.

  3. #163
    Join Date
    Dec 2005
    Beans
    135

    Re: How-to for crontab

    Quote Originally Posted by asadqamber View Post
    Now its working. cheers!

    Thanks for the help.
    Glad you got things to work.

  4. #164
    Join Date
    Jun 2009
    Beans
    27

    Wink Re: How-to for crontab


  5. #165
    Join Date
    Jul 2009
    Beans
    7

    Re: How-to for crontab

    Hi all !


    Im currently having problems with the cron - execution of a script i wrote that needs root - privileges. The root - account on my machine is deactivated so i won't be able to switch to root - user.

    I have done the following :

    original script : test.sh
    wrapper script : test2.sh ( just calls test.sh via "sudo completePathToScript/test.sh" )

    And i edited the crontab with "sudo crontab -e" to add the following line :

    /5 * * * * completePathToScript/test2.sh

    The script test.sh seems to run, but cannot fullfill the parts where 'root' is requirred...
    Is there a better way to achieve the goal (execute script with root rights via cron) ?

    I have read through this thread, but nothing seems to apply to my problem.
    Any help would be greatly appreciated!

    Thx in advance,
    M.

  6. #166
    Join Date
    Mar 2008
    Beans
    4,714
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: How-to for crontab

    When you run "sudo crontab -e" you are editing root's personal crontab.
    So all cron jobs run that way will already have root privileges.

    So there is no need for root to run test2.sh. Rather, it should be able to run test.sh.

    How about try

    Code:
    sudo crontab -e
    
    */5 * * * * completePathToScript/test.sh
    Note that the crontab entry needs "*/5" at the beginning not "/5" if you want the job to run every 5 minutes.

  7. #167
    Join Date
    Jul 2009
    Beans
    7

    Re: How-to for crontab

    Thx alot,


    the missing * was a typo - but your advice works perfectly !
    No need to "sudo - around" here !

    Thanks for your help,
    M.

  8. #168
    Join Date
    Nov 2007
    Location
    Newry, Northern Ireland
    Beans
    1,258

    Re: How-to for crontab

    Finally, I've got the CRON thing working. I'm using it to run a script from a Online Backup Manager to do an incremental backup of a server every evening and finally I'm not getting Backup Failed emails from the backup providers anymore. Their own scheduler did not work, but running a manual backup through CRON has solved the problem.

    Thanks for all the help.

  9. #169
    Join Date
    Jul 2009
    Beans
    1

    Re: How-to for crontab

    nice post
    some more information about crontab
    http://scripterworld.blogspot.com/20...tion-with.html

  10. #170
    Join Date
    May 2007
    Location
    England
    Beans
    205
    Distro
    Lubuntu

    Re: How-to for crontab

    Has it crossed anyone's mind that putting cron into a GUI would save everyone a lot of work and any idiot might be able to use it in seconds?

Page 17 of 20 FirstFirst ... 71516171819 ... LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •