Sponsored Content
Top Forums UNIX for Dummies Questions & Answers How to run a script automatically ????? Post 2227 by 98_1LE on Monday 30th of April 2001 12:31:25 PM
Old 04-30-2001
To enter the above data that PxT shared, you can type 'crontab -e' and edit the file. If it opens it in an unknown editor, set your EDITOR variable to vi or another editor. You can also put the entry in an arbitrary flat file and execute
crontab flat_file
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

how to run a Script automatically

How to make a script run automatically using a cron?? i do not know abt cron...... if i have simple.sh file and i need this to run everyday at a particular time what needs to be done thanks in advance (4 Replies)
Discussion started by: hamsa
4 Replies

2. Shell Programming and Scripting

how to run shell script automatically

hi , i m trying to run bash scrip automaticially but i dont know how i can do this an anybody tell me how i can autorun shell script when i logon . thanks (9 Replies)
Discussion started by: tahir23
9 Replies

3. Shell Programming and Scripting

Automatically run bash script

Hi! I want to run/execute a bash script automatically everytime when a specific file is created or when its timestamp changes. Is this possible? How? Thank you very much for your answers in advance, Regards, Christoph (1 Reply)
Discussion started by: ckofler
1 Replies

4. Shell Programming and Scripting

How to run a script automatically

Hi All, How can i run a script every week automatically. Thanks & regards, Sam (5 Replies)
Discussion started by: sam25
5 Replies

5. Shell Programming and Scripting

variable has no value if run the script automatically/scheduled

Hi All, I am using ksh as the shell. I have a script that should store variable after executing "onstat" on informix. I can execute it successfully without any issue if run manually, however the value is not showing up when run automatically(scheduled). Is there anything needed to make the... (1 Reply)
Discussion started by: tungaw2004
1 Replies

6. AIX

How to run a script automatically when AIX version 7 server reboots?

Am new to AIX please help me. I have AIX7 server. When ever the system reboots my script need to run automatically. This will help me to start my application automatically after the server reboot. Thanks, Prince Wells (9 Replies)
Discussion started by: prince1987
9 Replies

7. Shell Programming and Scripting

How to run script automatically on reboot as root user?

Hi friends,,, I am running one server on Ubuntu 12.04 LTS 32-bit, some times my pc restarts automatically, with no reason, I have a script to start server which requires root password. in this directory /myserver/start_server.sh How can I do this ? and some scripts I am having that I... (1 Reply)
Discussion started by: Akshay Hegde
1 Replies

8. Shell Programming and Scripting

How to run script automatically every 12 hour once?

Hi ! all, I have once script to remove temporary cache and temporary xml files looks like this, as it is taking more space, I would like to run automatically every 12 hour once, and then I want to receive some log as acknowledgement #!/bin/sh echo "Removing logs and temp files (typically... (4 Replies)
Discussion started by: Akshay Hegde
4 Replies

9. Shell Programming and Scripting

Run a script before and after reboot automatically and send output to two locations.

Hello Team . I am working a health check script ( bash) to run on linux server ( RedHat) and requirements are 1. The o/p of script need to be send to two diff files . I am testing with tee command . But I am not successful yet , any recommendations if that is the right approach ? 2. The same... (2 Replies)
Discussion started by: Varja
2 Replies
CRONTAB(1)						      General Commands Manual							CRONTAB(1)

NAME
crontab - maintain crontab files for individual users (Vixie Cron) SYNOPSIS
crontab [ -u user ] file crontab [ -u user ] [ -i ] { -e | -l | -r } DESCRIPTION
crontab 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 though these are files in /var/spool/cron/crontabs, they are not intended to be edited directly. If the /etc/cron.allow file exists, then you must be listed (one user per line) therein in order to be allowed to use this command. If the /etc/cron.allow file does not exist but the /etc/cron.deny file does exist, then you must not be listed in the /etc/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. If both files exist then /etc/cron.allow takes precedence. Which means that /etc/cron.deny is not considered and your user must be listed in /etc/cron.allow in order to be able to use the crontab. Regardless of the existance of any of these files, the root administrative user is always allowed to setup a crontab. For standard Debian systems, all users may use this command. If the -u option is given, it specifies the name of the user whose crontab is to be used (when listing) or modified (when editing). If this option is not given, crontab examines "your" crontab, i.e., the crontab of the person executing the command. Note that su(8) can confuse crontab and that if you are running inside of su(8) you should always use the -u option for safety's sake. 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 -l option causes the current crontab to be displayed on standard output. See the note under DEBIAN SPECIFIC below. The -r option causes the current crontab to be removed. The -e option is used to edit the current crontab using the editor specified by the VISUAL or EDITOR environment variables. After you exit from the editor, the modified crontab will be installed automatically. If neither of the environment variables is defined, then the default editor /usr/bin/editor is used. The -i option modifies the -r option to prompt the user for a 'y/Y' response before actually removing the crontab. DEBIAN SPECIFIC
The "out-of-the-box" behaviour for crontab -l is to display the three line "DO NOT EDIT THIS FILE" header that is placed at the beginning of the crontab when it is installed. The problem is that it makes the sequence crontab -l | crontab - non-idempotent -- you keep adding copies of the header. This causes pain to scripts that use sed to edit a crontab. Therefore, the default behaviour of the -l option has been changed to not output such header. You may obtain the original behaviour by setting the environment variable CRONTAB_NOHEADER to 'N', which will cause the crontab -l command to emit the extraneous header. SEE ALSO
crontab(5), cron(8) FILES
/etc/cron.allow /etc/cron.deny /var/spool/cron/crontabs There is one file for each user's crontab under the /var/spool/cron/crontabs directory. Users are not allowed to edit the files under that directory directly to ensure that only users allowed by the system to run periodic tasks can add them, and only syntactically correct crontabs will be written there. This is enforced by having the directory writable only by the crontab group and configuring crontab com- mand with the setgid bid set for that specific group. STANDARDS
The crontab command conforms to IEEE Std1003.2-1992 (``POSIX''). This new command syntax differs from previous versions of Vixie Cron, as well as from the classic SVR3 syntax. DIAGNOSTICS
A fairly informative usage message appears if you run it with a bad command line. cron requires that each entry in a crontab end in a newline character. If the last entry in a crontab is missing the newline, cron will consider the crontab (at least partially) broken and refuse to install it. AUTHOR
Paul Vixie <paul@vix.com> is the author of cron and original creator of this manual page. This page has also been modified for Debian by Steve Greenland, Javier Fernandez-Sanguino and Christian Kastner. 4th Berkeley Distribution 19 April 2010 CRONTAB(1)
All times are GMT -4. The time now is 10:44 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy