Skip to main content

Timeline for crontab not launching one script

Current License: CC BY-SA 3.0

24 events
when toggle format what by license comment
S Mar 24, 2015 at 16:22 history bounty ended CommunityBot
S Mar 24, 2015 at 16:22 history notice removed CommunityBot
Mar 21, 2015 at 7:03 answer added Prinz timeline score: 0
Mar 17, 2015 at 9:15 history edited Peter CC BY-SA 3.0
reverted to original question with /var/logs
Mar 17, 2015 at 9:13 vote accept Peter
Mar 17, 2015 at 9:13 answer added Peter timeline score: 1
Mar 16, 2015 at 16:22 comment added ott-- Can you add a hexdump of the first lines of your crontab? Try hexdump -C /var/spool/cron/user, if it's not there check the location with man 5 crontab.
Mar 16, 2015 at 15:39 answer added user77853 timeline score: 0
Mar 16, 2015 at 15:20 history edited Peter CC BY-SA 3.0
deleted 7 characters in body
S Mar 16, 2015 at 15:19 history bounty started Peter
S Mar 16, 2015 at 15:19 history notice added Peter Draw attention
Mar 12, 2015 at 14:23 comment added Peter @ott I did it we will see. I highly doubt about it because script shows up in /var/log/cron log
Mar 12, 2015 at 12:01 comment added ott-- Could your crontab be damaged by CR-LF line endings instead of LF only? Can you do export EDITOR=vim ; crontab -e and then within vim :set notextmode followed by :wq.
Mar 12, 2015 at 9:30 comment added Peter every other script works fine, no problem at all pastebin.com/ittTk2tu scripts are made of echos and wgets only. same permissions, same user/group. i dont get it
Mar 12, 2015 at 9:23 comment added Peter @ott I changed it to #!/bin/bash also I added ( date ; set) >> /tmp/cron.log as 2nd line in script after shebang, but no file has been created. I ran script manually, file has been created, script works like many other similar scripts. This is entry from /var/log/cron Mar 12 07:35:01 serverpro1 CROND[18484]: (root) CMD (/var/www/import/download_offers.sh &> /var/logs/download_offers_cron.log) but no single file has been created, script doesn't work at all
Mar 11, 2015 at 9:24 history edited Peter CC BY-SA 3.0
added 34 characters in body
Mar 10, 2015 at 17:22 comment added ott-- NB: your crontab says SHELL=/bin/bash, then in your script you use #!/bin/sh. Your cron is really running as root so it can write to the directories where your logs go? Can you add a ( date ; set ) >>/tmp/cron.log as 2nd line to your script?
Mar 10, 2015 at 15:32 comment added Peter @CosmoF i dont think thats not a case, my "script" is just bunch of echos and wgets
Mar 10, 2015 at 15:30 history edited Peter CC BY-SA 3.0
added 268 characters in body
Mar 10, 2015 at 14:11 comment added Cosmo F If you run it manually and it works, but doesn't work in cron, then there probably is an environment variable issue. Cron by default only provides a very minimal shell environment. Pay particular attention to PATH and perhaps LD_LIBRARY_PATH varaiables. Best to manually set all required variables in your script than depend on cron to provide. One way to tell what cron provides is to add a very simple cron entry 1 * * * * env > /tmp/cron.env (make sure you delete this entry after it's run as it will keep running at 1 minute after the hour forever if you don't)
Mar 10, 2015 at 13:00 comment added Peter @ManulaWaidyanatha it works fine
Mar 10, 2015 at 11:59 comment added Manula Waidyanatha Run the scrip manually and see if there are any errors
Mar 10, 2015 at 11:48 answer added Nitesh B. timeline score: 0
Mar 10, 2015 at 11:34 history asked Peter CC BY-SA 3.0