Page 19 of 20 FirstFirst ... 917181920 LastLast
Results 181 to 190 of 191

Thread: How-to for crontab

  1. #181
    Join Date
    Aug 2010
    Beans
    1

    Re: How-to for crontab

    Great examples.

    Always use full paths in cron!

  2. #182
    Join Date
    Oct 2010
    Location
    The United States
    Beans
    843
    Distro
    Ubuntu

    Re: How-to for crontab

    Hi,

    I use a really cool program called autokey-gtk the only problem is that over time it takes more and more ram. I found that quitting the program and restarting it will keep the program from becoming so bloated that it no longer functions.

    I'd really like to be able to automatically have the program launch then 58 minutes later automatically quit and then after one minute relaunch.

    I'm not sure how to do this. I tried adding 01 * * * * autokey-gtk via crontab -e to see if I could get the program to launch. It didn't work.

    I'd appreciate any help.

    Thank you.
    Thank you,
    GG -----------

  3. #183
    Join Date
    Jan 2011
    Beans
    1

    Re: How-to for crontab

    Hello all, i`m new with Ubuntu and i like it but i`m having trouble installing a cronjob i vahe try`d but it not working like i want to so i figure i miss spelled something in the command

    i did crontab -e ( unde root username )

    added this line there
    Code:
    59 *    * * *  cd /home/PATCH TO FILE/psychostats3.1 &&  ./stats.pl && echo "Stats update: $(date)" >>  /tmp/mybackup.log
    From what i`v read in this topic this line should run ./stats.pl and add a line in mybackup.log every 59 minutes.

    If there is something wrong there please someone help me figure this out .

    ps : sry for bad language.

    Nvm : working as intended thx too
    Last edited by Zasmoker; January 29th, 2011 at 05:16 PM.

  4. #184
    Join Date
    Jun 2011
    Beans
    1
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: How-to for crontab

    Thanks for this really useful HowTo. Could you please also tell us how to execute cronjobs requires authentication (like syncing a folder with a remote server over ssh)

  5. #185
    Join Date
    Jan 2008
    Beans
    185
    Distro
    Ubuntu 13.04 Raring Ringtail

    Re: How-to for crontab

    Quote Originally Posted by ardchoille View Post
    Thanks, that solves part of it. Any way to get that to be permanent?
    (He was talking about selecting the editor from which the cron file is edited)

    I don't know if this was answered to you in the way I did below, as I did not read every page in this thread, but check it out:

    Code:
    sudo select-editor
    **America != USA | American != Usanian**
    Own a Dell XPS M1530? Join the group!

  6. #186
    Join Date
    Jan 2008
    Beans
    185
    Distro
    Ubuntu 13.04 Raring Ringtail

    Re: How-to for crontab

    Oh thanks, that comes pretty handy to me just one question, does it start at 00 by default or is that something one can specify?
    **America != USA | American != Usanian**
    Own a Dell XPS M1530? Join the group!

  7. #187
    Join Date
    Nov 2011
    Beans
    12

    Re: How-to for crontab

    I tried searching on this thread for my problem but could not find anything.

    I have a QNAP TS259 with the most recent firmware. I log in as admin and then edit the admin crontab file to add two lines to run backup scipts. These were added the end of last week, and then today I saw that these entries were gone. I verified mid week they were there.

    It's as if the admin crontab file is being over written every so often.

    Is there a way to make the crontab changes stick.

  8. #188
    Join Date
    Jan 2013
    Beans
    9

    Re: How-to for crontab

    Hi all,

    I'm trying to simplify my crontab entries. I currently have them like:
    Code:
    1 1 * * * root /scripts/test.sh >>/scripts/test.sh.log 2>>/scripts/test.sh.err
    and these work just fine. However, I'd like to replace the redirects with variants of the actual script name - something like:
    Code:
    1 1 * * * root /scripts/test.sh >>&0.log 2>>&0.err
    The only format I've found for use of the & in crontab entries is like:
    Code:
    1 1 * * * root /scripts/test.sh >/scripts/test.sh.log 2>&1
    Note: The redirects need to be appendable (i.e. I must be able to use >> instead of > )

    Is this possible?

    Thanks for any and all suggestions/help.
    Dirk

  9. #189
    Join Date
    Jan 2013
    Beans
    9

    Re: How-to for crontab

    I wasn't familiar with what the 2>&1 was actually doing. Found some good info on it.
    http://stackoverflow.com/questions/8...ell-what-is-21

    I found some other info on accessing the name of the script that's running (in bash, this would be $0). So, my next attempt looked like:
    Code:
    1 1 * * * root /scripts/test >>$0.log 2>&1
    It does produce a file; unfortunately, it's named .log and it winds up in the root user's directory.

    So, I renamed test.sh to test2.sh, and created /scripts/test.sh which contains:
    Code:
    #!/bin/bash
    /scripts/test2.sh >>$0.log 2>>%0.err
    which is invoked by the crontab entry:
    Code:
    1 1 * * * root /scripts/test.sh >/dev/null 2>&1
    Log is now written to /scripts/test.sh.log and errors to /scripts/test.sh.err. Bit of a hack, but yea!

    Dirk

  10. #190
    Join Date
    Aug 2012
    Beans
    1

    Re: How-to for crontab

    Hi, can someone please help or redirect me?

    I am running kubuntu 12.04I have scheduled tasks in System Settings - Task Scheduler.
    Now, some of these tasks do run properly, others don't. When I type crontab -l I can see the tasks set in the task scheduler, but if I opne etc/crontab with Kate, for instance, I see only a few root commands.
    When one of those tasks is not run, I see in syslog the line:
    (root) CMD (if [ -x /usr/bin/gsmsmsrequeue ]; then /usr/bin/gsmsmsrequeue; fi)
    My questions are:
    1. What file is crontab -l reading?
    2. Why some tasks do run and others don't?
    3. Where should I place the MAILTO= to have emails from cron sent to my email?
    4. What is gsmsmsrequeue and what is it doing here?


    Thank you

Page 19 of 20 FirstFirst ... 917181920 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
  •