The system startup files are located in /etc/rc2.d. You can add a file to this directory with the commands you want to run at system startup. Suppose you want to delete some temp files at system startup, you could put a file named TempFileDel in your /etc/rc2.d with the commands to delete your temporary files, so it'll run every time system reboots.
Helo.
As shereenmotor says, usually, startup scripts are located in /etc/rc2.d, but this depends on the UNIX/Linux you run and your system's default run level.
But I'm afraid it's not that easy. The script name must follow some rules:
- There are two kind of scripts, let's say: kill scripts and start scripts. Both stored in /etc/rcX.d.
- kill scripts are executed first, after that start scripts.
- kill scripts name must start with a "K".
- start sctipts name must start with a "S".
- Following the first letter, there must be a two digit number. This lets "rc" know the order for the execution of the sctrips. rc is the "master" script which calls the others. Have a look at your /etc/inittab.
- Finally, a name of your choice.
when "rc" calls this scripts it adds a parameter: start for "S" scripts and stop for "K" scripts. This allows you to use the same script for both operations, just using links.
Well, the UNIX boot process is a little bit more complicated, but for now that's enough.
In your case, you could create a scritp called TempFileDel (contuinuing with shreenmotor's example) which supports "start" and "stop" operations/parameters. For instance:
and then:
Hi,
1)
If some job supposed to run on 1st of every month at 7 AM
In cron job when we have a blackout on the 1st ( i.e when 1st falls on a sunday ) how can we make the job run the next business day?
2) How can we run a job on 25th of every quarter 7 AM(jan,apr,jul,oct)
And if 25th... (5 Replies)
I have submitted an autosys job and force start it. Autosys hit the job 4 times to restart but it did not start and finally I terminate the job. Any idea why the job did not start. Below is the code I executed.
1214 missun0ap /export/home/bzn97r/develop/dswi/jil$ sendevent -E FORCE_STARTJOB... (0 Replies)
Hi ,
I have removed a cron for particular user , but cron job seems to be running even after the cron entry is removed. The purpose of the cron was to sendmail to user ( it uses mailx utility )
I have restarted cron and sendmail service still user is getting mail alerts from the cron job. And... (4 Replies)
Hi guys,
How can I specify the start and end time of a cron job. And my start time and end time are specified by minutes. For example, I want to set up a cron runs every 3 minutes from 18:40 to midnight. How can i do this please? Many thanks
Best regards,
Clu (4 Replies)
I am trying to get the string containing date - in a specfic format actually, although I think that part is inconsequencial - 1110226^1110226^1110226^1110226^1110226 - through echo or printf or in some other way - created within a cront job and passed as a parameter to a perl script.
Now, I know... (3 Replies)
Hi Experts,
I need a script advice to schedule 12 jobs ( SAS Codes execute back ground ).
Algorithem:
1. Script checks first job.
2. Finds first job is done; invoke second job.
3. finds second job is done; invoke third job.
..
Request you to please assist. (3 Replies)
I would like to setup a Cron job to check weather X process is running or not. if it is not running then start that X process with a log message....
can any one help writing a script?
thanks (3 Replies)
I run cron in solaris 10 zone. One cron job which syncing files to nfs mounted on container, creates after finishing another cron proccess(/usr/sbin/cron), and after 100 existing cron proccesses next cron job will not start. It's too weird for me, I'm not able to solve this problem. Theoretically... (3 Replies)
Hi Experts,
I'm a SAP Basis, I have a small doubt would request you please help on this...
1. I wold like to copy files from one system to another system?
as per my knowledge "we have to mount the prod filesystem on the quality box and do a copy every day thru crontab script, or do it via... (2 Replies)
Hi,
can you please help me with one problem?
There is some server, there are a lot of AIX applications which run on this server under different UserIDs.
These applications starts via crontab.
From time to time some application doesn't start.
What can this "not-action" be dependent on?
At... (5 Replies)