Results 1 to 5 of 5

Thread: cron doesn't work...

  1. #1
    Join Date
    May 2009
    Location
    Liège Walifornia
    Posts
    389

    Default cron doesn't work...

    Greetings !!

    I use fwbackups to set up sets of backups.
    This application let us set a cron to be executed, here each day of each month at 16:30.

    But I have to set it manually... cron won't execute this.

    The script (bash) is put in /usr/bin... and have the execution permissions.

    Code:
    #!/bin/bash
    echo "Sauvegardes des travaux et du répertoire netbeans..."
    /usr/bin/fwbackups-run -l 'travaux'
    /usr/bin/fwbackups-run -l 'netbeans'
    echo "...done !!"
    The crontab -e shows:
    Code:
    30 16 * * * /usr/bin/backupz.sh
    With a new line at the end of the line...

    How can I make it run at 16:30 each day of the year ??

  2. #2
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,117

    Default Re: cron doesn't work...

    Please always show the part of the computer session complete. That is prompt, command, output (the only thing we seem to have here) and the next prompt. Like this:
    Code:
    henk@boven:~> crontab -l
    no crontab for henk
    henk@boven:~>
    Now a lot of information is lacking. Also saying : "The script (bash) is put in /usr/bin... and have the execution permissions." is only small talk. Please post:
    Code:
    ls -l /usr/bin/backupz.sh
    cat /usr/bin/backupz.sh
    To make us see for ourselves.
    And in the same style:
    Code:
    crontab -l
    Else we realy can not check if you did it correct and most of us will doubt that "cron does not work".

    Some remarks:
    I personaly never would litter the system with my own applications in such a way. My advice would be to use /usr/local/bin instead of /usr/bin.

    I would always redirect output of my cron runs to some place and not let cron put it in mails to the crontab owner (do you read those mails?). And some place might be /dev/null, or some log file dedicated to the application.
    Henk van Velden

  3. #3
    Join Date
    May 2009
    Location
    Liège Walifornia
    Posts
    389

    Default Re: cron doesn't work...

    ok...

    crontab -l

    Code:
    # DO NOT EDIT THIS FILE - edit the master and reinstall.
    # (/tmp/crontab.f7SgHn installed on Fri Oct 14 01:40:36 2016)
    # (Cronie version 4.2)
    30 16 * * * backupz
    #30 16 * * * fwbackups-run -l 'netbeans' # autogenerated by fwbackups
    #30 16 * * * fwbackups-run -l 'travaux' # autogenerated by fwbackups
    cd /usr/bin
    ls -lah backupz

    Code:
    lrwxrwxrwx 1 root root 29 Oct 14 01:50 backupz -> /utilitaires/shell/backupz.sh
    cd /utilitaires/shell
    ls -lah backupz.sh

    Code:
    -rwxr-xr-x 1 root root 165 Oct 10 16:12 backupz.sh


    cat backupz.sh

    Code:
    #!/bin/bash
    echo "Sauvegardes des travaux et du répertoire netbeans..."
    /usr/bin/fwbackups-run -l 'travaux'
    /usr/bin/fwbackups-run -l 'netbeans'
    echo "...done !!"
    I read the mails. And I purge them when there is too much entries.

  4. #4
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,117

    Default Re: cron doesn't work...

    Firs a remark about posting those statements with their ouput. WWhat is esier that copy/pase the whole, like:
    Code:
    boven:~ # crontab -l
    # DO NOT EDIT THIS FILE - edit the master and reinstall.
    # (/tmp/crontab.lx6zuM installed on Sat Mar 19 10:30:17 2016)
    # (Cronie version 4.2)
    */5 0-6,23 * * *        /root/bin/nachtstop
    
    */5 * * * *     /root/bin/wij
    boven:~ #
    As you see above we have also the prompt and the command. Same amount of "work" to post it (bit larger sweep with the mouse), but much more information. Now you pestered yourself by not including the commands, then posting those separate, making them bold for no reason) and we still do not have the prompts.

    I read the mails. And I purge them when there is too much entries.
    I do not understand. You say you get mails from cron. And you main complaint is
    Cron doesn't work...
    When "Cron does not work", how can you then get mails?
    And what is in those mails. You never told us!

    BTW, I always would mention the full pathes in cron entries:
    Code:
    30 16 * * * /usr/bin/backupz
    Henk van Velden

  5. #5
    Join Date
    May 2009
    Location
    Liège Walifornia
    Posts
    389

    Default Re: cron doesn't work...

    Tried all advices with full pathnames -- as other computer running 13.2 with fwbackups with cron that works, I tried the same settings (without full path).
    For this computer I have to do backups manually... cron won't work.

    Both computers have the same settings (locations for the script, symbolic link in /usr/bin, ...) , the only thing that is not the same is that on the computer with cron working the backup folder is located in the same partition. As the fwbackup manual process works I can't believe this is a problem.

    I will try something different but I have to announce cron.daily won't work, I already tried...

Posting Permissions

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