10-06-2010
In cron... always use absolute paths for all commands, and file paths...
for find command you have to use.
also for the rm command use absolute path.
Last edited by thegeek; 10-06-2010 at 07:42 AM..
Reason: missed to mention in cron, which is important
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
OS is Ubuntu 8.04.3. When I run the command:
/usr/bin/syslogMailer < /etc/syslog.pipes/criticalMessagesFrom a bash shell it works and i receive an email as per the script however when run from crontab it does not work. Can anyone explain why and how to fix it?
/usr/bin/syslogMailer... (4 Replies)
Discussion started by: jelloir
4 Replies
2. Shell Programming and Scripting
Hi everyone,
when executing this command in unix:
echo "WM7 Fatal Alerts:", $(cat query1.txt) > a.csvIt works fine, but running this command in a shell script gives an error saying that there's a syntax error.
here is content of my script:
tdbsrvr$ vi hc.sh
"hc.sh" 22 lines, 509... (4 Replies)
Discussion started by: 4dirk1
4 Replies
3. Programming
Dear community,
I'm driving crazy with a strange issue.
I have a simple script to transfer a file to a remote system:#!/bin/bash
echo "put /tmp/server.log" > /tmp/server1_transfer.sftp
sftp -b /tmp/server1_transfer.sftp user@10.99.1.2:Between client and server there is a SSH KEY, so if I run... (15 Replies)
Discussion started by: Lord Spectre
15 Replies
4. Shell Programming and Scripting
I am working with a sh script on a solaris 9 zone (sol 10 host) that grabs information to build the configuration command line. the variables Build64, SSLopt, CONFIGopt, and CC are populated in the script. the script includes
CC=`which gcc`
CONFIGopt=' --prefix=/ --exec-prefix=/usr... (8 Replies)
Discussion started by: oly_r
8 Replies
5. UNIX for Dummies Questions & Answers
I have a script like this running under OS X 10.8. The problem arises when the find command encounters a space in the path name. I need the "dir" variable as I'll be extending the script to more general use.
#!/bin/bash
CFS=$IFS
IFS=$(echo)
set dir = "/Users/apta/Library/Mail\... (3 Replies)
Discussion started by: apta
3 Replies
6. Shell Programming and Scripting
Hi,
My script runs fine from the command line, but when crontab tries to launch it encounters lack of permissions:
could not open /dev/kbd to get keyboard type US keyboard assumed
could not get keyboard type US keyboard assumed
split: Permission denied
This is the head of the script:
... (2 Replies)
Discussion started by: Cvg
2 Replies
7. Shell Programming and Scripting
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
8. Shell Programming and Scripting
I wish to search for a particular string say "Yellow_Colors" in all files in all folders in the current directory.
Below is the command I use:
find ./ -type f | xargs grep -i "Yello_Colors"However, my command does not traverse all files and folders and errors out mid-way with the below error... (7 Replies)
Discussion started by: mohtashims
7 Replies
9. Shell Programming and Scripting
more cron.txt
1 * * * * /u/ways.sh 2>&1 >/dev/null
bash-4.1$ export EDITOR=vi
bash-4.1$ crontab -e <cron.txt
Vim: Warning: Input is not from a terminal
Vim: Error reading input, exiting...
Vim: Finished.
The crontab file was not changed.
bash-4.1$ echo $?
1
bash-4.1$ uname -a
SunOS... (3 Replies)
Discussion started by: mohtashims
3 Replies
10. Shell Programming and Scripting
Hi,
I am looking for a generic find command that works on both Linux and Solaris.
I have the below command that works fine on Linux but fails on solaris.find /web/config -type f '(' -name '*.txt' -or -name '*.xml' -name '*.pro' ')' Fails on SunOS mysolaris 5.10 Generic_150400-61 sun4v sparc... (1 Reply)
Discussion started by: mohtashims
1 Replies
LEARN ABOUT MOJAVE
crontab
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