10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I'm trying to get a crontab to run, every Friday at 11am and the problem is that it isn't running at all.
0 11 * * 6 /Users/martinb/Documents/SYSADMIN/Regular-Scripts/Info-And-Backups.sh
Here's a link to a screenshot of my script (I've censored my email address).
Screen Shot 2017 11 03... (3 Replies)
Discussion started by: $shell_Learner
3 Replies
2. 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
3. Shell Programming and Scripting
Hi Expert,
I have a .sh script in my home/new_dir/script.sh
This script creates number of output files at home/new_dir/email, home/new_dir/logs dir.
I am running this script using crontab (owner root).
Now this output files are getting created with
rw-r----- 1 root root
So if i... (2 Replies)
Discussion started by: Jeet1982
2 Replies
4. Shell Programming and Scripting
cat /home/lyang001/update.sh
#!/bin/sh
#shopt -s expand_aliases
HOME_DIR=/home/lyang001/updates
UPDATE_MAIL=${HOME_DIR}/updates.mail
rm $UPDATE_MAIL -rf
cd $HOME_DIR/wr-kernel
git log --no-merges --since="20 day ago" --name-status --pretty=format:"%an %h %s %cd" origin/WRLINUX_5_0_1_HEAD >>... (2 Replies)
Discussion started by: yanglei_fage
2 Replies
5. Shell Programming and Scripting
If I run 'who -u' interactively or from a script invoked through bash in a tty on my Ubuntu 12LTS box I get an output like this:
testuser pts/0 Dec 9 02:32 . 2163 (host.xx.yy)
running the same through cron I get:
testuser pts/0 2012-12-09 02:32 00:05 2163... (2 Replies)
Discussion started by: latimer
2 Replies
6. Shell Programming and Scripting
Hi All,
I have around 900 Select Sql's which I would like to run in an awk script and print the output of those sql's in an txt file.
Can you anyone pls let me know how do I do it and execute the awk script? Thanks. (4 Replies)
Discussion started by: adept
4 Replies
7. HP-UX
Hi All
I have a problem, I wonder if you can help me sort it out:
I have the following entry in the cron:
00 1,13 * * * /home/report/opn_amt_gestores_credito.ksh > opn_amt_gestores_credito.log
But the entry only runs at 01:07
I have stopped the cron deamon, and started, but it still... (39 Replies)
Discussion started by: fretagi
39 Replies
8. Shell Programming and Scripting
Hi,
I have a script which checks to see if an app is running and will restart it if it is not.
For some reason when I run it from the crontab it always says it is not running.
The script is as follows: -
#!/bin/sh
#
# The following script will look for the PID of SickBeard and output... (15 Replies)
Discussion started by: simpic
15 Replies
9. Solaris
Hi experts,
I want to set the crontab for my script which will run every 20 seconds
I think below could be the possible one-
*/3 * * * * /export/home/username/scripts/runing.sh
As my system(SOLARIS 9) is live- i am confused to implement before make sure !!!
I need... (4 Replies)
Discussion started by: thepurple
4 Replies
10. HP-UX
Hi all,
I need to run a shell script every 6 days using crontab. I've been searching a bit and found the following syntax for this:
* * */6 * * /apps/temp/maxx.sh > /apps/temp/maxx.log 2>&1
respectively
* * 0/6 * * /apps/temp/maxx.sh > /apps/temp/maxx.log 2>&
Unfortunately when trying to... (8 Replies)
Discussion started by: Endo
8 Replies
crontab(1) General Commands Manual crontab(1)
NAME
crontab - user job file scheduler
SYNOPSIS
[file]
[username]
[username]
[username]
DESCRIPTION
The command manages a crontab file for the user. You can use a crontab file to schedule jobs that are executed automatically by (see
cron(1M)) on a regular basis. The command has four forms:
Create or replace your crontab file
by copying the specified file, or standard input if file is omitted or is specified as file, into the crontab
directory, The name of your crontab file in the crontab directory is the same as your effective user name.
If the compartmentalization feature is enabled, the crontab file is your effective user name followed by a
colon followed by the compartment id from which the crontab file is created.
Edit a copy of the user's crontab file, or create an empty file to
edit if the crontab file does not exist. When editing is complete, the file will be copied into the crontab
directory as the user's crontab file. If the compartmentalization feature is enabled, it only edits a copy
of the user's crontab file from the compartment that the crontab files were created from.
Lists the user's crontab file.
If the compartmentalization feature is enabled, it only lists the crontab files from the compartment that the
crontab files were created from.
Remove the user's crontab file from the crontab directory.
If the compartmentalization feature is enabled, it only removes the crontab files from the compartment that
the crontab files were created from.
Only a privileged user can use username following the or options, to edit, list, or remove the crontab file of the specified user.
The entries in a crontab file are lines of six fields each. The fields are separated by spaces or tabs. The lines have the following for-
mat:
minute hour monthday month weekday command
The first five are integer patterns that specify when the sixth field, command, should be executed. They can have the following ranges of
values:
minute The minute of the hour,
hour The hour of the day,
monthday The day of the month,
month The month of the year,
weekday The day of the week,
Each pattern can be either an asterisk meaning all legal values, or a list of elements separated by commas. An element is either a number
in the ranges shown above, or two numbers in the range separated by a hyphen (meaning an inclusive range). Note that the specification of
days can be made in two fields: monthday and weekday. If both are specified in an entry, they are cumulative. For example,
runs command at midnight on the first and fifteenth of each month, as well as every Monday. To specify days in only one field, set the
other field to asterisk For example,
runs command only on Mondays.
The sixth field, command (the balance of a line including blanks in a crontab file), is a string that is executed by the shell at the spec-
ified times. A percent character in this field (unless escaped by a backslash is translated to a newline character, dividing the field
into "lines". Only the first "line" (up to a or end-of-line) of the command field is executed by the shell. Any other "lines" are made
available to the command as standard input.
Blank lines and those whose first non-blank character is will be ignored.
invokes the command from the user's directory with the POSIX shell, It runs in the queue (see queuedefs(4)).
supplies a default environment for every shell, defining:
Users who desire to have their executed must explicitly do so in the crontab entry or in a script called by the entry.
You can execute if your name appears in the file If that file does not exist, you can use if your name does not appear in the file If only
exists and is empty, all users can use If neither file exists, only the user can use The files consist of one user name per line.
Security Restrictions
If the compartmentalization feature is enabled, and invoke the jobs from the compartment that the jobs were created from. Note that cre-
ates the job files in Hence, if the command is invoked from a compartment which has no write access to this directory and which disallows
the privilege, fails to schedule the jobs. See compartments(5) and privileges(5) for more information.
EXTERNAL INFLUENCES
Environment Variables
determines the interpretation of text within file as single and/or multibyte characters.
determines the language in which messages are displayed.
If or is not specified in the environment or is set to the empty string, the value of is used as a default for each unspecified or empty
variable. If is not specified or is set to the empty string, a default of "C" (see lang(5)) is used instead of
If any internationalization variable contains an invalid setting, behaves as if all internationalization variables are set to "C". See
environ(5). determines the editor to be invoked when option is specified. The default editor is vi.
International Code Set Support
Single-byte and multibyte character code sets are supported.
WARNINGS
Be sure to redirect the standard output and standard error from commands. If this is not done, any generated standard output or standard
error is mailed to the user.
FILES
Main cron directory
List of allowed users
List of denied users
Accounting information
Directory containing the crontab files
SEE ALSO
sh(1), cron(1M), queuedefs(4), compartments(5), privileges(5).
STANDARDS CONFORMANCE
crontab(1)