The hint to the problem root cause was given by:
The explanation should be that, when executed from crontab, the environment initialization files (.bashrc, .bash_profile, etc) are not read, so that the PATH variable is not initialized with the path of the sshpass executable.
Hi there:
I run rsync very well by typing:
rsync -avz /source /destination
Then I want to run it by cron. So I had a crontab file like this:
* * * * * rm file
* * * * * rsync -avz /source /destination > cron_result
(The first line is used to test whether cron is working.)
When I check... (0 Replies)
I've got a ksh script that works like a charm when I run it manually. When I set it up in a cron, I keep getting this error in my log:
syntax error at line 90: `$' unexpected
Here's my snippet of code starting at line 90:
while ]
do
sleep 900
done
What's the... (5 Replies)
Hi,
I am running a rsync via cron job.
Its running fine and is scheduled to 9:00 AM everyday.
Sometimes it runs for more than 24 hours, such that the next days cron also fires.
Now how will the sync happen as the <sync file> that both crons have created might conflict.
Thanks (5 Replies)
I set up a cron job to FTP to another machine. If I have not logged in before the time the cron is set to run, then the ftp program won't connect. I have run this cron on other boxes (diff networks) and it works fine...it is just this one. If anyone has any suggestions as to what would be... (5 Replies)
Hi,
I've created a cron job for a script with a rsync command in it. The script is named pull.sh and contains the following line :
What it is supposed to do is pull backup files from the production server of my company to my local server. It should also generate the log file (output.log)... (1 Reply)
Good morning,
The script below without the hilited text successfully FTPs the files in question to the other server when it is called from the crontab. I don't want to establish an FTP connection when there are no files so I tried including the hilited lines to only establish an FTP connection... (6 Replies)
/usr/bin/find $SEARCH_DIR -daystart \( \( -name 'KI*' -a -name '*.csv' \) -o -name '*_xyz_*' \) -mtime $DAYS_AGO -printf %f -printf "\n" | sort -r > $FILES
The above command gives different results when run on a cron job. When run manually the result is accurate. (2 Replies)
Ubuntu 9.10 is my linux distro
Based on forums they say that the problem is with environment .
here is my case:
login as user, then sudo -s
using this command: s3cmd put file s3://bucket >>worked!
now here is the simple script intended for testing:
#! /bin/bash
env >/tmp/cronjob.log... (1 Reply)
Hi All,
I have a many cron jobs scheduled in my AIX server.
Only one cron not getting executed in the same server but that job is good on all other servers.
Here is my cron , which will keep last 30 files and remove others.,
00 00 * * * /usr/bin/find /tmp/reports/nmon -name *.nmon -mtime... (9 Replies)
Hello gurus,
I am making what I think is a simple db2 call from within a shell script but I am having difficulty producing the desired
report when I run the script shown below from a shell script in cron. For example, my script and the crontab file setup
is shown below:
#!/bin/ksh
db2... (3 Replies)
Discussion started by: okonita
3 Replies
LEARN ABOUT OPENSOLARIS
getexecname
getexecname(3C) Standard C Library Functions getexecname(3C)NAME
getexecname - return pathname of executable
SYNOPSIS
#include <stdlib.h>
const char *getexecname(void);
DESCRIPTION
The getexecname() function returns the pathname (the first argument of one of the exec family of functions; see exec(2)) of the executable
that started the process.
Normally this is an absolute pathname, as the majority of commands are executed by the shells that append the command name to the user's
PATH components. If this is not an absolute path, the output of getcwd(3C) can be prepended to it to create an absolute path, unless the
process or one of its ancestors has changed its root directory or current working directory since the last successful call to one of the
exec family of functions.
RETURN VALUES
If successful, getexecname() returns a pointer to the executables pathname; otherwise, it returns 0.
USAGE
The getexecname() function obtains the executable pathname from the AT_SUN_EXECNAME aux vector. These vectors are made available to dynam-
ically linked processes only.
A successful call to one of the exec family of functions will always have AT_SUN_EXECNAME in the aux vector. The associated pathname is
guaranteed to be less than or equal to PATH_MAX, not counting the trailing null byte that is always present.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|MT-Level |Safe |
+-----------------------------+-----------------------------+
SEE ALSO exec(2), getcwd(3C), attributes(5)SunOS 5.11 17 Dec 1997 getexecname(3C)