How would i schedule a job on ESX


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers How would i schedule a job on ESX
# 1  
Old 06-30-2010
How would i schedule a job on ESX

Hi I m using a machine for VMWARE setup.
machine details.
Code:
#uname -a
VMkernel testmachine.test.com 3.5.0 #1 SMP Release build-110271 Aug 12 2008 19:36:55 i686 unknown


the problem is i m not able to schedule a job using crontab as
crontab is not found on the machine.

Code:
~ # crontab -e
-ash: crontab: not found

current shell.
Code:
~ # echo $SHELL
/bin/ash

Even chsh is not working.
Code:
 chsh -l
-ash: chsh: not found

When checked in bin directory i found bash to be present over there . How would i change the shell ?
will changing the shell cause the crontab to be working?
Code:
~ # cd /bin
/bin # ls
ash                gpg                passwd             sfcbuuid
awk                grep               ping               sh
bash               groups             prop_of_instances  stat
busybox            gzip               ps                 tail
cat                head               rm                 ticket
cim-diagnostic.sh  kill               scp                uname
cp                 less               sfcbdump           vim-cmd
cut                login              sfcbmof            vmware
dbclient           ls                 sfcbmofpp          vmware-vimdump
dropbearconvert    lsi_log            sfcbrepos          vmx
dropbearkey        mkdir              sfcbstage          wbemcat
echo               openssl            sfcbunstage        xmltest


Last edited by pludi; 06-30-2010 at 03:51 AM..
# 2  
Old 06-30-2010
Bash and crontab have 2 things in common: they run on most Unices, and both are written (largely) in C. That's it.

Searching on the net I found this. Basically, you have to edit /var/spool/cron/crontabs/root directly.
This User Gave Thanks to pludi For This Post:
# 3  
Old 06-30-2010
Quote:
Originally Posted by pludi
Bash and crontab have 2 things in common: they run on most Unices, and both are written (largely) in C. That's it.

Searching on the net I found this. Basically, you have to edit /var/spool/cron/crontabs/root directly.
I could not able to see the link given as it is blocked in our office environment.

However i m still not able to schedule the job. m i missing anything?
I checked the current timing
Code:
/sbin # date
Wed Jun 30 05:27:48 UTC 2010

then modified the root file to run the coyfile.sh
Code:
/sbin # cat /var/spool/cron/crontabs/root
#syntax : minute hour day month dayofweek command
01 01 * * * /sbin/tmpwatch.sh
01 * * * * /sbin/auto-backup.sh #first minute of every hour (run every hour)
00,10,20,30,40,50 * * * * /sbin/decodeSel.sh #Every 10 minutes, translate the latest IPMI SEL data
30 05 30 6 wed /sbin/copyfile.sh #Testing purpose

content of my script
Code:
# cat copyfile.sh
#!/bin/ash
touch test.txt

I m not able to see the test.txt created in /sbin directory .

Please guide.
# 4  
Old 06-30-2010
Since you can't access that site, here's the relevant part:
Quote:
  1. Edit /var/spool/cron/crontabs/root
  2. Add the line (all on one line)
    5 0 * * * /full/path/to/script arguments/with/full/path > /full/path/to/logfile 2>&1
  3. Run the command "cat /var/run/crond.pid"
    That will print the process number of the running crond, such as 12345
  4. Run the command "kill 12345"
    where "12345" should be replaced with the number output by the previous command
Note that this won't survive a reboot of the ESX server. You'll have to edit /etc/rc.local for that.
# 5  
Old 06-30-2010
Quote:
Originally Posted by pludi
Since you can't access that site, here's the relevant part:
Note that this won't survive a reboot of the ESX server. You'll have to edit /etc/rc.local for that.
there is no such file named crond.pid.

Code:
cat /var/run/crond.pid

Content of /var/run
Code:
/var/run # ls
dcui.pid             slpd.pid             vmware-hostd-ticket
inetd.pid            syslogd.pid
sfcb-watchdog.pid    vmware

# 6  
Old 06-30-2010
There is a ps command in your /bin. There's a grep in your /bin. Put the two together:
Code:
# ps -ef | grep cron

The second column is the PID.

And you do know that this forums intent isn't to provide step-by-step guides for basic tasks like "research"?
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

schedule a job without Cron

Hi All, Is there any way (any utility) to schedule a job to run once in a week on RedHat Linux ? Note- Do not using Crontab. Thanks Pravin (1 Reply)
Discussion started by: pravin27
1 Replies

2. Shell Programming and Scripting

schedule job

Hi, I have a spcific box called abc in autosys and below that there are 2 jobs. my requirement is to run the abc box only on monday and rest of the day the rest of the jobs should be in success status.. ---------- Post updated at 03:11 PM ---------- Previous update was at 02:45 PM ----------... (4 Replies)
Discussion started by: j_panky
4 Replies

3. UNIX for Dummies Questions & Answers

Schedule a cron job

Hi, Can anyone help me out with scheduling a cron job for the below: i wnated to delete file from a folder on every sunday at 05:00 AM this is code i have used. ******************************************************* 0 05 * * 0 find /abc/xyz/pqrs/bak/ -type f -mtime +30 -exec rm -f... (5 Replies)
Discussion started by: ch33ry
5 Replies

4. UNIX for Dummies Questions & Answers

Schedule a corn job

Hi, I new to cron job... I need to schedule a job that runs on a particular day at a specific time say for example need to send a test mail at around 2:30PM on wed 10th August i have used the below syntax, but the job was not executed. 30 14 * * * echo "message from UNIX... (3 Replies)
Discussion started by: ch33ry
3 Replies

5. Shell Programming and Scripting

Schedule a Cron job

Hi all, I am new to cron jobs.. i wanted to schedule a cron job that wil send a mail to me at 3:00PM on 10th August ie is on Wednesday. 0 15 10 8 3 echo "message from UNIX here"|mail -s "your subject here" user@user.com However this was not executed... Can anyone please... (0 Replies)
Discussion started by: ch33ry
0 Replies

6. AIX

Schedule Job

how to schedule a job in aix, pls explain with cmd (1 Reply)
Discussion started by: udtyuvaraj
1 Replies

7. Shell Programming and Scripting

Schedule a job using Crontab

I would like to execute my script at 17.30 and 23.00 using crontab, could anybody help me out!! Thanks in Advance!! (1 Reply)
Discussion started by: jatanig
1 Replies

8. Shell Programming and Scripting

unable to schedule job in cron

Hi, from normal user(oracle) i am unable to run scheduled job in cron: os version: bash-2.03$ uname -a SunOS sumail02 5.8 Generic_117350-39 sun4u sparc SUNW,Ultra-60 bash-2.03$ crontab -l 55 * * * * sh /oracle/statistics.sh > /dev/null 2>&1 bash-2.03$ cat /oracle/statistics.sh... (2 Replies)
Discussion started by: prakash.gr
2 Replies

9. UNIX for Advanced & Expert Users

How to schedule a job

Hi, How can i schedule a job, i.e a program named p found at path a/b/c, to run at a time T everyday? Thanks (5 Replies)
Discussion started by: ashvik
5 Replies
Login or Register to Ask a Question