Page 3 of 19 FirstFirst 1234513 ... LastLast
Results 21 to 30 of 190

Thread: How-to for crontab

  1. #21
    Join Date
    Feb 2007
    Location
    Brampton, Ontario
    Beans
    883

    Question Re: How-to for crontab

    pidgas,

    Thanks! I just did the following:

    Code:
    crontab -e
    then this is crontab now:
    Code:
    # m h  dom mon dow   command
    0 22 * * *      export DISPLAY=:0 && /usr/bin/oocalc
    /home/bobby/Desktop/bffmtracking.xls
    "

    but I get this on exiting nano after saving it:
    Code:
    crontab: installing new crontab
    "/tmp/crontab.k2bMoS/crontab":2: bad minute
    errors in crontab file, can't install.
    Do you want to retry the same edit?
    I have changed the minutes to 00 and 0, still the same tho.

    ???
    "For those who believe, no explanation is necessary. For those who do not, none will suffice." - Joseph Dunninger

  2. #22
    Join Date
    Mar 2005
    Location
    Malaysia
    Beans
    300
    Distro
    Ubuntu 6.06 Dapper

    Re: How-to for crontab

    Quote Originally Posted by herbster View Post
    pidgas,

    Thanks! I just did the following:

    Code:
    crontab -e
    then this is crontab now:
    Code:
    # m h  dom mon dow   command
    0 22 * * *      export DISPLAY=:0 && /usr/bin/oocalc
    /home/bobby/Desktop/bffmtracking.xls
    "

    but I get this on exiting nano after saving it:
    Code:
    crontab: installing new crontab
    "/tmp/crontab.k2bMoS/crontab":2: bad minute
    errors in crontab file, can't install.
    Do you want to retry the same edit?
    I have changed the minutes to 00 and 0, still the same tho.

    ???
    I don't think you should have a carriage return after your /usr/bin/oocalc line. As far as I know, each crontab should be on one line only. Thats why we have the "&&"(which means "and") to string the commands together.

    I tried adding a carriage return to separate my commands, and had a similar error..that bad minute thingy. I think the "2" in your error message is pointing to the line that the error occurs. (The "#" means its a comment, and probably doesn't count. But I'm not an expert on this )

    Hope this helps.

    Cheers,
    Kinson

  3. #23
    Join Date
    Feb 2007
    Location
    Brampton, Ontario
    Beans
    883

    Re: How-to for crontab

    Kinson,

    The check is in the mail my friend, that worked like a charm! It actually wasn't a carriage return, it was a normal space, but it was going to the next line because of the size of my Terminal window. I maximized it and it is now on one line, no error, and I just set it to run now and it ran perfectly. Thanks!!!
    "For those who believe, no explanation is necessary. For those who do not, none will suffice." - Joseph Dunninger

  4. #24
    Join Date
    Mar 2005
    Location
    Malaysia
    Beans
    300
    Distro
    Ubuntu 6.06 Dapper

    Re: How-to for crontab

    Quote Originally Posted by herbster View Post
    Kinson,

    The check is in the mail my friend, that worked like a charm! It actually wasn't a carriage return, it was a normal space, but it was going to the next line because of the size of my Terminal window. I maximized it and it is now on one line, no error, and I just set it to run now and it ran perfectly. Thanks!!!
    Yeah, I just tried that. It does seem to do that...weird :/ Maybe its some kinda word wrap setting in Nano(just guessing, absolutely no idea ).

    Anyways, glad you got it working, crontabs would be a major feature of Linux if you ask me

    Cheers,
    Kinson

  5. #25
    Join Date
    May 2007
    Beans
    52
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: How-to for crontab

    Does crontab give off a log ?

    I have this in my crontab

    Code:
     sudo crontab -l
    Password:
    # m h  dom mon dow   command
    12 * * * * /backup/scripts/rgwlinux.sh
    14 * * * * /backup/scripts/rgwforum.sh
    16 * * * * /backup/scripts/rgwgallery.sh
    18 * * * * /backup/scripts/rgwfishing.sh
    25 * * * * /backup/scripts/rgwfamily.sh
    20 * * * * /backup/scripts/rgwdatabase.sh

    TT

  6. #26
    Join Date
    Oct 2005
    Location
    Illinois
    Beans
    148
    Distro
    Ubuntu Breezy 5.10

    Re: How-to for crontab

    Crontabs are stored in:

    /var/spool/cron/crontabs

    and are stored per user name

  7. #27
    Join Date
    Apr 2007
    Location
    Calooca City, Philippines
    Beans
    177
    Distro
    Ubuntu 7.10 Gutsy Gibbon

    Re: How-to for crontab

    i needed this, thanks alot

  8. #28
    Join Date
    Jan 2006
    Beans
    56

    Re: How-to for crontab

    Great how-to. Thanks.

    But I have a question. I have a script that backs up several directories into individual tgz files.

    tar cvpjf BackupA.bz2 DirectoryA/
    tar cvpjf BackupB.bz2 DirectoryB/
    tar cvpjf BackupC.bz2 DirectoryC/

    and then moves them to a backup directory.

    The script works great when I run it from the command line, but whenever cron executes it, the tgz files are created but they are empty. What am I doing wrong here?

    Thanks.

  9. #29
    Join Date
    Feb 2007
    Location
    Brampton, Ontario
    Beans
    883

    Re: How-to for crontab

    rshel,

    Could be permissions of the directories? Do you use sudo when executing from CLI?
    "For those who believe, no explanation is necessary. For those who do not, none will suffice." - Joseph Dunninger

  10. #30
    Join Date
    Jan 2006
    Beans
    56

    Re: How-to for crontab

    I don't think its a permissions thing. The crontab executes the script as root.

Page 3 of 19 FirstFirst 1234513 ... 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
  •