05-25-2009
Crontab
I am new in shell script, but i made atm a script to add in crontab my script to run..
u can do this too...
i made this...
crontab -l > $TEMPFILE
#MODIFY u temp file...
#
# ( check if already exist u script in crontab
# if dont exists
# insert it
# fi
# ) PSEUDOCODE
crontab $TEMPFILE
rm $TEMPFILE
crontab in a terminal:
crontab -l : see u list of registers
crontab -e: edit u register
crontab -r: remove u register
format of crontab
MINUTS HOUR DAYSOFMONTH MONTH DAYOFWEEK COMMAND
0-57 * * * * FOLDER/script.sh
i got some trouble trying to put the "*" on file using bash and nobody aswer the other thread... so i used the begin-end like that...
MINUTS HOUR DAYSOFMONTH MONTH DAYOFWEEK COMMAND
0-57 0-23 1-31 1-12 0-7 FOLDER/script.sh
DAY OF WEEK: 0 and 7 is the same day...
this crontab is just to run for u user... to use for all user is another file...(i think is in /etc/crontab)...
PS: if need i can send my code to u or i can explain again
i hope this ll help u ,
Diogo
Last edited by diogooute; 05-25-2009 at 12:16 AM..
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
i want to run some solaris executable program (text file). i telnet to solaris machine. the text file is on the net drive h: or my local drive on windows system.
how can i copy the text file from local drive in windows to remote machine in solaris system?
thanks. (4 Replies)
Discussion started by: gary
4 Replies
2. UNIX for Dummies Questions & Answers
I am logged into a server via SSH.
There is a file on my desktop of my Windows PC I would like to put on that server.
How do I do it?
SCP looks the likely method but how does the server know where the file is on the local machine?
Thanks. (2 Replies)
Discussion started by: Sepia
2 Replies
3. Red Hat
Hi All,
URGENT - Please help me form a scipt for this:
I need the LATEST file from a dir on REMOTE machine to be SCP'd to a dir on local machine. (and I need to execute this from local server)
I know that the below cmd is used to find the LATEST file from a dir. But this command is not... (3 Replies)
Discussion started by: me_ub
3 Replies
4. Shell Programming and Scripting
Hi All..
Am new to Unix!!
Am creating a shell script in which a scenario is like i have transfer the output file from unix machine (Server) to local directory (Windows xp).
And also i have to transfer the input file from the local directory to Unix machine (Server)
Any help from you... (1 Reply)
Discussion started by: vidhyaS
1 Replies
5. Shell Programming and Scripting
I want example of a file representing the hard disk storage device In UNIX ? (6 Replies)
Discussion started by: tamer11007
6 Replies
6. UNIX for Advanced & Expert Users
Hi Am using unix Ksh
Am getting the problem while transferring zero size files through the script .
When i transfer zero size files from local machine to remote machine manually i can able to do it .
My question its beause of zero size files am not able to transfer through script ? or its... (2 Replies)
Discussion started by: Venkatesh1
2 Replies
7. UNIX for Dummies Questions & Answers
Hello,
I need to create a shell script which will copy files - which are created on particular date and starting with particular name - to local windows XP machine.
Is this possible.?
Currently it is being done manually using winscp (1 Reply)
Discussion started by: NarayanaPrakash
1 Replies
8. Red Hat
I want to SSH to 192.168.1.15 Server from my machine, my ip was 192.168.1.99
Source Destination was UP, with IP 192.168.1.15.
This is LAN Network there are 30 Machine's Connected to the network and working fine, I'm Playing around the local machine's because I need to apply the same rules in... (2 Replies)
Discussion started by: babinlonston
2 Replies
9. Shell Programming and Scripting
Team,
Presently i am running a script from my local box(i.e jumpbox) to all the remote machines.Basically fetching basic queries like pwd,mkdir,touch etc and i am able to successfully fetch it from my local machine.But when i want to check certain database related queries like the dbstat... (20 Replies)
Discussion started by: whizkidash
20 Replies
10. UNIX for Dummies Questions & Answers
Very new to shell scripting. Not sure if my title is correct but I will try and explain.
Directory has 100+ files with this format, " ABCD_ABC_Abc_AB0126.abc ". When a new file gets created, the 16-19 characters in the file name gets incremented by 1. Ex...todays most recent file is... (14 Replies)
Discussion started by: askvip
14 Replies
CRON(8) System Manager's Manual CRON(8)
NAME
cron - daemon to execute scheduled commands (Vixie Cron)
SYNOPSIS
cron
DESCRIPTION
Cron should be started from /etc/rc or /etc/rc.local. It will return immediately, so you don't need to start it with '&'.
Cron searches /var/spool/cron for crontab files which are named after accounts in /etc/passwd; crontabs found are loaded into memory. Cron
also searches for /etc/crontab and the files in the /etc/cron.d/ directory, which are in a different format (see crontab(5)). Cron then
wakes up every minute, examining all stored crontabs, checking each command to see if it should be run in the current minute. When execut-
ing commands, any output is mailed to the owner of the crontab (or to the user named in the MAILTO environment variable in the crontab, if
such exists).
Additionally, cron checks each minute to see if its spool directory's modtime (or the modtime on /etc/crontab) has changed, and if it has,
cron will then examine the modtime on all crontabs and reload those which have changed. Thus cron need not be restarted whenever a crontab
file is modified. Note that the Crontab(1) command updates the modtime of the spool directory whenever it changes a crontab.
SEE ALSO
crontab(1), crontab(5)
AUTHOR
Paul Vixie <paul@vix.com>
4th Berkeley Distribution 20 December 1993 CRON(8)