LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 12-05-2016, 03:25 AM   #1
Springs
Member
 
Registered: Apr 2008
Posts: 73

Rep: Reputation: 0
Ubuntu server issues running bash script via cron


hi all,

i've got a bash script on my ubuntu server. I can run it manually but when i try and schedule it via cron, the script will run but it will miss out the actual commands it's trying to run.

Now as i can run this script manually without any issues so i believe it to be an environment / cron issue.

within the script, specifically it's trying to call gcalcli with some variables which is where i believe it's skipping as i've told it to output everything to a txt/log file and it's the only thing i can't see.

any ideas on what i can do?
 
Old 12-05-2016, 04:04 AM   #2
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,309
Blog Entries: 3

Rep: Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721
Is the script setting $PATH explicitly? If not, that would be one thing to try first. That is one of the variables that is different between an interactive shell and a cron job.
 
Old 12-05-2016, 04:36 AM   #3
Springs
Member
 
Registered: Apr 2008
Posts: 73

Original Poster
Rep: Reputation: 0
ah i think you are right.

i've been calling gcalcli as is and not specified the full path. I've just tested with the full patch via cron and i did get a valid response. I'll test again shortly to confirm.

didn't think it would be as easy as it was.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
bash issue with sed command not running under cron. could be whole script DirtyHowi Programming 8 08-12-2014 02:29 PM
Cron jobs not running on server (Ubuntu 11.10) jamespetts Linux - Server 8 01-23-2012 03:34 PM
Issue in running shell script using cron job in Unix server. Mundlamuri Programming 7 07-12-2011 11:37 AM
bash script running by cron fakie_flip Programming 17 12-24-2007 10:26 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 04:38 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration