So a few suggestions to get your script neater only making one external call:-
Can you run your code both from the command line and scheduled but adding set -x just before you try to curl and see a difference between the trace output.
Obviously, if you post output here, overwrite the credentials so they are not published to the world.
I have an alias already in my .bash_profile to download files using cUrl's -o (output to file, user provides the file name) option. I find I'm using it quite a bit, so I wanted to write a script to run "curl -o", taking the necessary inputs - file name and URL from which to download - and then... (3 Replies)
Hi,
I am using curl to hit a url using http in solaris 10 using commandline, I want to transfer an attachment(using multipart curl -F) also as a part of the request. If anyone has used kindly help me with the syntax. I am using below command:
Code:
/usr/local/bin/curl -v... (1 Reply)
I'm running a curl command in bash, but the & in the middle causes the second half of the line to run in the background, here's what I'm trying to do:
lat="37.451"
lon="-122.18"
url="http://ws.geonames.org/findNearestAddress?lat=$lat&lng=$lon"
curl -s "$url"
I tried escaping the & with \&,... (4 Replies)
Hi All
I am using curl in my client environment. We need to pull a file from the libraries site. All the files are having perticular URL which can be used to get the files. Only issue is, when we fire that command , it will take to authentication page 1st. once authentication is succed, it will... (1 Reply)
Hi,
I am running on Ubuntu 12 (precise) 64 bit and came to know that i cannot install any packages using apt-get and aptitude.
Linux test01 3.5.0-23-generic #35~precise1-Ubuntu SMP Fri Jan 25 17:13:26 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
But the same /etc/apt/sources.list file is... (20 Replies)
Hello experts!
I have a file1 with the following format (yr,day, month, hour,minute):
201201132435
201202141210
201304132030
201410100110
...
What i want to do is to assign variables and then use them in the curl command to download the text of each event from a web page.
What I have... (6 Replies)
Hi,
I'm trying to write a script to determine the time gap between HTTP PUT and HTTP DELETE requests in the HTTP Servers access log.
Normally client will do HTTP PUT to push content e.g. file_1.txt and 21 seconds later it will do HTTP DELETE, but sometimes the time varies causing some issues... (3 Replies)
Hello.
I have pick up a script from internet to track errors from curl command.
#!/bin/bash
#
URL_TO_TEST="http://www.xxxxxx.yyy"
MY_VAR=curl_init("$URL_TO_TEST") ;
curl_setopt($MY_VAR, CURLOPT_HEADER, 1);
curl_setopt($MY_VAR, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($MY_VAR,... (2 Replies)
Hello Experts ,
I have an use case which needed your help . I have been using google for 2 days buy couldn`t succed , i believe i can get the help here.
Here is my use case to run on bash shell
1. Access an URL -- in script , it will be mentioned as inputURL
2. Once i accessed the URL... (5 Replies)
Hello,
My question is about curl command. (ubuntu14.04)
In terminal, I am able to download my mainfile with:
curl -u user1:pass1 http://11.22.33.44/*******
When I convert it into bash script like this:
#!/bin/bash
cd /root/scripts
computer_ip=11.22.33.44
curl -u $1:$2... (8 Replies)
Discussion started by: baris35
8 Replies
LEARN ABOUT REDHAT
link
LINK(2) Linux Programmer's Manual LINK(2)NAME
link - make a new name for a file
SYNOPSIS
#include <unistd.h>
int link(const char *oldpath, const char *newpath);
DESCRIPTION
link creates a new link (also known as a hard link) to an existing file.
If newpath exists it will not be overwritten.
This new name may be used exactly as the old one for any operation; both names refer to the same file (and so have the same permissions and
ownership) and it is impossible to tell which name was the `original'.
RETURN VALUE
On success, zero is returned. On error, -1 is returned, and errno is set appropriately.
ERRORS
EXDEV oldpath and newpath are not on the same filesystem.
EPERM The filesystem containing oldpath and newpath does not support the creation of hard links.
EFAULT oldpath or newpath points outside your accessible address space.
EACCES Write access to the directory containing newpath is not allowed for the process's effective uid, or one of the directories in old-
path or newpath did not allow search (execute) permission.
ENAMETOOLONG
oldpath or newpath was too long.
ENOENT A directory component in oldpath or newpath does not exist or is a dangling symbolic link.
ENOTDIR
A component used as a directory in oldpath or newpath is not, in fact, a directory.
ENOMEM Insufficient kernel memory was available.
EROFS The file is on a read-only filesystem.
EEXIST newpath already exists.
EMLINK The file referred to by oldpath already has the maximum number of links to it.
ELOOP Too many symbolic links were encountered in resolving oldpath or newpath.
ENOSPC The device containing the file has no room for the new directory entry.
EPERM oldpath is a directory.
EIO An I/O error occurred.
NOTES
Hard links, as created by link, cannot span filesystems. Use symlink if this is required.
CONFORMING TO
SVr4, SVID, POSIX, BSD 4.3, X/OPEN. SVr4 documents additional ENOLINK and EMULTIHOP error conditions; POSIX.1 does not document ELOOP.
X/OPEN does not document EFAULT, ENOMEM or EIO.
BUGS
On NFS file systems, the return code may be wrong in case the NFS server performs the link creation and dies before it can say so. Use
stat(2) to find out if the link got created.
SEE ALSO symlink(2), unlink(2), rename(2), open(2), stat(2), ln(1)Linux 2.0.30 1997-12-10 LINK(2)