How to set automatic run?


 
Thread Tools Search this Thread
Operating Systems Solaris How to set automatic run?
# 1  
Old 03-15-2012
How to set automatic run?

Hi,

I have a script in my home directory. it has to be run every day. as of now, im manually running as ./myscript.sh

Can someone please tell me how to set it as automatic run (runs everyday at specific time ) so that it runs even if im not there.
# 2  
Old 03-15-2012
# 3  
Old 03-15-2012
Hi, Thanks for providing the link.

it seems im not authorized to use cron in our application's server. is there any other way ???
# 4  
Old 03-15-2012
Hi Jskobs,

You have to be enabled to use cron in Solaris now, however there are other ways to do this.

You could check out the "at" command, however there may be a requirement to be enabled to use that. Or you could try just creating a script that checks the time, since the script has run using a timestamp on a file, if the time since the last run is 24h + run it again.

Regards

Dave
# 5  
Old 03-15-2012
Thanks for the reply Dave,

I didn't get the logic you mentioned, can you explain ?
# 6  
Old 03-15-2012
As I said, cron is now a specific allow - so you would have to speak to a systems admin and they would allow you to run cron.

However it may be that you could set up an at job, using the following;

Code:
at -t 20120401120000 ./myscript.sh

This would run your script at noon on the first of April.

Or you could create a script which when executed would wait for a specific time and then run the script.

If it's just to cover time off - then I might use at, but then check "man at"

The first port of call should be the systems admin, who will allow the cron job if it is important.

Reagards

Dave

Last edited by gull04; 03-15-2012 at 10:54 PM.. Reason: Couldn't spell job.
# 7  
Old 03-15-2012
go to crontab -e
edit the time, date, etc.
example:
0 6 * * * /home/directory/your_script.sh
explanation:
your script will run everyday at exactly 6am in the morning.
just edit the directory by typing pwd (the exact location of your script)
be sure to edit the permission of your file to make cron/scheduled run of your script to work (chmod o+x your_script.sh)
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Set script to run during specific times

Hi all, I have this script which sends mail whenever the system is down. It works fine. Normally the system is down from 21 00 to 21 30 from Monday to Saturday and from 21 00 on Sunday to Monday 06 00 for maintenance. So I want the below script to run only when the system is up, i.e outside the... (2 Replies)
Discussion started by: frum
2 Replies

2. Shell Programming and Scripting

Perl: connect to network devices, run set of commands

I am trying to write a script for my own use that will allow me to connect to network devices, then run a set of commands. I start with a list of ips in a text file. Each ip is on its own line. I start with a second file of commands. Each command on one line. for illustration .. the cmd.txt... (2 Replies)
Discussion started by: popeye
2 Replies

3. Shell Programming and Scripting

run a script to set a globle varible?

Hi, My original shell is csh, I don't likw it, so I have to run bash every time after I login, the problem is I have a script like export PLOG=$1, every time I run the script under bash, the PLOG won't be set, I know I can use source to set the PLOG, is there any other way to do it? ... (3 Replies)
Discussion started by: laopi
3 Replies

4. UNIX for Advanced & Expert Users

Where to set the right "Apache" to run after reboot on a RedHat 5 machine ?!

Hi, I'am working on a RedHat server (V5) and having on it 2 Apache instances, but after each reboot i have the wrong one starting so that i have to stop it doing "httpd -k stop" and than launch the right one doing "/etc/init.d/httpd -k start". For more Details, you may see the link i inserted... (4 Replies)
Discussion started by: mehdi1973
4 Replies

5. Shell Programming and Scripting

Need help howto make a script for Set SNOOP run for 5 minutes

Hi all, I want to monitoring my interface every 6 hours where i want to run snoop command to capture all packet through the interface, so i want running snoop then snoop will run for 5 minutes after that snoop stop then will start again after 6 hours than run for 5 minutes again. thereis any... (9 Replies)
Discussion started by: tindasz
9 Replies

6. Shell Programming and Scripting

How to set dialog to run from a command line ?

Hi, finally successfully native compiled dialog. To run I have to change directory to /opt/dialog/bin and run ./dialog So I see I have to set up configuration file and global environment. But how ? I run make install. And another issue is I run dialog connecting via putty terminal... (3 Replies)
Discussion started by: jack2
3 Replies

7. Shell Programming and Scripting

How to run a set of commands through ssh

I need to run a set of commands on a remote machine using ssh. it should also collect output and return status of each command. Can someone help me how to do this? (1 Reply)
Discussion started by: vickylife
1 Replies

8. Shell Programming and Scripting

set schedule to run a script at background while logout

Hi, How can I run a script at 9:00am and 6:00pm everyday? Can I run it at background while I logout my account? Please help!! Many Thanks!! (1 Reply)
Discussion started by: happyv
1 Replies

9. Shell Programming and Scripting

Is it possible..when ftp session disconnect and it can automatic run again?

Hi, Is is possible when ftp script disconnect by remote server and it can restart to tranfer (such as restart in 10 mins, etc)? Please help!!!! (1 Reply)
Discussion started by: happyv
1 Replies

10. UNIX for Advanced & Expert Users

how to set the environment variable at run time

hi, I have one environment variable like path in my system.But in my program i need to change that path .suppose it has a value "config" now i need to chage it as "config1" or something else.i need to use that variable for complete project.It means at first it will use the old path but after... (4 Replies)
Discussion started by: sada@123
4 Replies
Login or Register to Ask a Question