Sponsored Content
Top Forums Shell Programming and Scripting Script containing Curl doesn't run with crontab Post 303006812 by beautymind on Wednesday 8th of November 2017 06:16:45 AM
Old 11-08-2017
Thank you Robin for your reply,
uname -a returns :
Code:
Linux aocsv155bed0p.cloudwatt.saint-gobain.net 3.10.0-327.36.3.el7.x86_64 #1 SMP Mon Oct 24 16:09:20 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

and this piece of code returns fail thoug it works fine in th command line :

Code:
if /usr/bin/curl -LS -D- -X GET -H "Authorization:Basic $password" -H 'Content-Type: text/csv' -L -o  $OUTPUT_FILENAME $url; then
                       # if wget GET password=$password -H 'Content-Type: text/csv' password=$password  -o  $OUTPUT_FILENAME $url; then
                            echo "success"
                        else
                            echo "fail"
                        fi

Moderator's Comments:
Mod Comment Please use CODE tags as required by forum rules!

Last edited by RudiC; 11-08-2017 at 07:31 AM.. Reason: Added CODE tags.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell script doesn't get executed using crontab

I have the following crontab entry to run a shell script for every 30 minutes of every day: 30 * * * * $HOME/main.sh > $HOME/main.log 2>$HOME/error.log after I created the crontab file I have also done: $crontab my_crontab I also check to make sure it exists, by using the following... (11 Replies)
Discussion started by: radhika
11 Replies

2. Shell Programming and Scripting

When things doesn't run into crontab???

Could someone explain my problem? I've the following script... #! /bin/ksh ... vmquery -m $MediaID | awk ' BEGIN {FS=": " getline expdate <"ExpDate.txt" } $1 ~ /media ID/ {MediaNumber = $NF} ... $1 ~ /number of mounts/ { "date +%Y"|getline YearToday Year4 = YearToday - 4 if... (4 Replies)
Discussion started by: nymus7
4 Replies

3. Shell Programming and Scripting

Script doesn't work as expected when run on cron

The script checks for free space stats on Oracle. If there are any tablespaces with more than 85% usage it prints the details of the tablespace. If all the tablespaces have more than 15% free space, then "All tablespaces have more than 15 pct free space" must be printed on the screen. When I run... (2 Replies)
Discussion started by: RoshniMehta
2 Replies

4. Shell Programming and Scripting

Expect script doesn't work under crontab

Hi All, Using Expect script when I run it manually it works. But when I put the entry in crontab, the job is still running after 15 hours. The script was created as root. I don't think it's a permission issue. Any idea? This is what I have under root crontab... 00 18 * * 1-5... (4 Replies)
Discussion started by: samnyc
4 Replies

5. UNIX for Dummies Questions & Answers

Script doesn't run

Hi everyone, I've written a script, I gave it permission by > chmod u+x myscript and then tried to run it with > myscript and it didn't work, so I've written > ./myscript again, it didn't work, so I've written > set path = (. $path) but it didn't work as well. I have some... (6 Replies)
Discussion started by: shira
6 Replies

6. Shell Programming and Scripting

curl doesn't work in browser

Hi I need once again you help guys, I have a php script that should call and url on the local-server, when i call the script from the browser it just prints the $str and it doesn't call the url, but when i execute the script from the shell (php sentdata.php) it works. I checked the apache... (6 Replies)
Discussion started by: tafil
6 Replies

7. Shell Programming and Scripting

run script through crontab using ksh

hi i have a script called test.sh. the content is ls >> crontest.txt. if i run manually it's giving output.but if i scheduled in crontab it's not giving output. crontab entry: 02 * * * * /sms5/SMSHOME/eds_sh/test.sh >> /sms5/SMSHOME/eds_sh/testfile/logfile 2>&1 I am using ksh.is there... (2 Replies)
Discussion started by: muraliinfy04
2 Replies

8. Shell Programming and Scripting

Script fails to run properly when run from CRONTAB

Hello all, I'm trying to write a script to gather and send data and it works just fine at the bash command line, but when executing from CRON, it does not run properly. My scripting skills are pretty limited and there's probably a better way, but as I said it works at the command line, but... (12 Replies)
Discussion started by: rusman
12 Replies

9. Shell Programming and Scripting

Curl doesn't return csv file

Hi every body, I'm getting a trouble with my script , it's supposed to return a csv file . /usr/bin/curl -LS -D- -X GET -H "Authorization:Basic $password" -H 'Content-Type: text/csv' -L -o $OUTPUT_FILENAME $url; But I get an empty file with : {"ErrorCode":1001,"ErrorMessage":"Incorrect login... (0 Replies)
Discussion started by: beautymind
0 Replies

10. Shell Programming and Scripting

Shell Script run curl command calling cyber-Ark RESTAPI

Hi All, We have a requirement to Integrate Cyber-Ark with Informatica . Basically cyberark will contain the username and password for Database. First step will be 1)In shell Script run curl command calling cyber-Ark RESTAPI requesting the credentials and store the secret in a variable. ... (0 Replies)
Discussion started by: Praveena9102
0 Replies
CRONTAB(1)						    BSD General Commands Manual 						CRONTAB(1)

NAME
crontab -- maintain crontab files for individual users (V3) SYNOPSIS
crontab [-u user] file crontab [-u user] { -l | -r | -e } DESCRIPTION
The crontab utility is the program used to install, deinstall or list the tables used to drive the cron(8) daemon in Vixie Cron. Each user can have their own crontab, and they are not intended to be edited directly. (Darwin note: Although cron(8) and crontab(5) are officially supported under Darwin, their functionality has been absorbed into launchd(8), which provides a more flexible way of automatically executing commands. See launchctl(1) for more information.) If the /usr/lib/cron/cron.allow file exists, then you must be listed therein in order to be allowed to use this command. If the /usr/lib/cron/cron.allow file does not exist but the /usr/lib/cron/cron.deny file does exist, then you must not be listed in the /usr/lib/cron/cron.deny file in order to use this command. If neither of these files exists, then depending on site-dependent configuration parameters, only the super user will be allowed to use this command, or all users will be able to use this command. The format of these files is one username per line, with no leading or trailing whitespace. Lines of other formats will be ignored, and so can be used for com- ments. The first form of this command is used to install a new crontab from some named file or standard input if the pseudo-filename '-' is given. The following options are available: -u Specify the name of the user whose crontab is to be tweaked. If this option is not given, crontab examines ``your'' crontab, i.e., the crontab of the person executing the command. Note that su(1) can confuse crontab and that if you are running inside of su(1) you should always use the -u option for safety's sake. -l Display the current crontab on standard output. -r Remove the current crontab. -e Edit the current crontab using the editor specified by the VISUAL or EDITOR environment variables. The specified editor must edit the file in place; any editor that unlinks the file and recreates it cannot be used. After you exit from the editor, the modified crontab will be installed automatically. FILES
/usr/lib/cron/cron.allow /usr/lib/cron/cron.deny DIAGNOSTICS
A fairly informative usage message appears if you run it with a bad command line. SEE ALSO
crontab(5), compat(5), cron(8), launchctl(1) STANDARDS
The crontab command conforms to IEEE Std 1003.2 (``POSIX.2''). The new command syntax differs from previous versions of Vixie Cron, as well as from the classic SVR3 syntax. AUTHORS
Paul Vixie <paul@vix.com> BSD
December 29, 1993 BSD
All times are GMT -4. The time now is 04:45 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy