Sponsored Content
Top Forums Shell Programming and Scripting To run crontab script with specific user Post 303044975 by vbe on Tuesday 10th of March 2020 04:44:42 AM
Old 03-10-2020
Try to write the job as shown, and show us what it gives...
by default only root is configured to use cron but you can customise and enable other users... The same for at
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

recurring run of sh script in crontab

Hello gurus. I have a problem: my crontab -e is looks like this: ORACLE_SID=bla-bla * 21 * * * (sqlplus hotback/hotback @/oracle/backups/bla-bla/scripts/hotback/daily_hotback.sql) 0 19 * * * /oracle/backups/dev10g/scripts/exports/daily_exports.sh 0 1 * * *... (4 Replies)
Discussion started by: MarGur
4 Replies

2. Shell Programming and Scripting

How do i run a shell script without crontab.

Hi Folks, Could you please suggest me how to run a shell script on a solaris env without using crontab. I am actually trying to write a shell script which will grep "WORD" in the logfile andd sends a email.Thanks in advance. Thanks Sandeep. (3 Replies)
Discussion started by: sandeep anand
3 Replies

3. AIX

Crontab cannot run by non-root user

Good morning everybody. I have just receiedv a complaint from our DBA saying that if he create a scripts to run some Oracle performance scripts using crontab and the scheduling part is ok but the job is failed when I checked on /var/adm/cron/log. I have tried his scripts using Oracle id directly... (4 Replies)
Discussion started by: kwliew999
4 Replies

4. Shell Programming and Scripting

Script not running properly when run from Crontab

Hi I am a novice Linux/Perl user and am struggling to overcome what I am sure is a simple problem. I am using a perl program to create a shell script daily containing between 10 and 30 "at -f" commands for the same day. Then I change the file attributes to allow the file to be executed. When... (2 Replies)
Discussion started by: simoncjones
2 Replies

5. Shell Programming and Scripting

Can run a ".sh" script as the user but not from the crontab

Hello Everyone, I am logged in as me. I created a script in the directory "/install/new" called "script1.sh" which basically runs another script "runapp.sh" . The "runapp.sh" is a vendor provided application strart up script that came with the installation. This is also in the same directory as... (10 Replies)
Discussion started by: bhaire
10 Replies

6. Shell Programming and Scripting

crontab fails to run script

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

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. UNIX for Dummies Questions & Answers

Script does not run from a user specific cronjob.

Hello, I have two crontabs, one for the root and one for another user. There is a script in my configurations that has to send a email. The script works and sends the emails when I run it by hand with either the root or the user, and when I program it in the root's crontab. But! It does not... (3 Replies)
Discussion started by: Tralaraloro
3 Replies

9. 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

10. Shell Programming and Scripting

Script containing Curl doesn't run with crontab

Hello I have a problem with the crontab command when I run a code containing Curl on the command line it runs without fail but as soon as I program it with crontab it executes everything except the curl returns fail thank you for helping me to resolve this problem because since Monday I look... (14 Replies)
Discussion started by: beautymind
14 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)
All times are GMT -4. The time now is 07:02 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy