Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2000 07:30 AM
08-25-2000 07:30 AM
#./crontab -l
[result is: /sbin/sh: ./crontab: not found.]
what's wrong!?
i am trying to create crontab.
how to create a crontab ??
very step-by-step pls!!!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2000 07:39 AM
08-25-2000 07:39 AM
Re: crontab
Create your cronfile
and then to activate crontab cronfile
crontab -l will display what scheduled
crontab -r will remove
crontab -e if you wish to modify (I prefer editing cronfile..)
Regards
Victor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2000 07:39 AM
08-25-2000 07:39 AM
Re: crontab
Just try 'crontab -l' to list your current crontab.
To create a crontab, use your favourite editor to create a file containing your cron information. (see the man pages for crontab and cron). Then just type 'crontab
You can also use the 'crontab -e' command to edit the current crontab file.
cron keeps crontab files in the directory
/usr/spool/cron/crontabs.
It is worth having a set procedure for editing crontab files, saving the previous version is a good idea.
Regards,
John
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2000 07:42 AM
08-25-2000 07:42 AM
Re: crontab
You would enter:
crontab -e (you can now key the when/what you want to run)
Quick example:
00 1 * * 1,2,3,4,5 /usr/local/bin/startup_oracle.sh
This would kick off the job startup_oracle.sh at 1 minute past midnight every Monday-Friday.
Then save the file. And run:
crontab 'your_new_file' to start your file to run.
To display what is set to run/cron:
crontab -l
To start or run the cronfile
crontab /full_path/cronfile_name
Hope this helps,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2000 07:43 AM
08-25-2000 07:43 AM
Solutionls -al crontab.root (if exists, go to the next)
cd crontabs
cp /var/spool/cron/crontab.root /var/spool/cron/crontabs/root
(copy the crontab.root example file one lever down in crontabs directory with the name as root.
vi root
add your modifications.
/sbin/init.d/cron stop
/sbin/init.d/cron start
crontab -l
That's it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2000 07:43 AM
08-25-2000 07:43 AM
Re: crontab
And, what i did:
# cd /var/spool/cron/crontabs
# ls
[result : there is nothing]
this means there is no user ???
1)as far as know, in order to use 'crontab' command, i have to know username, is that right??
2)in order to check username, i can check from #cd /vsr/spool/cron/crontabs then #ls,
is that right??
3)once i know the username, then i can do
# ./crontab -l username,
is that right???
pls, give a clue, thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2000 07:46 AM
08-25-2000 07:46 AM
Re: crontab
Good luck
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2000 07:49 AM
08-25-2000 07:49 AM
Re: crontab
Abd do not forget to go to
cd /var/adm/cron
vi cron.allow
add the user name (you'll have
root
oracle
..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2000 07:51 AM
08-25-2000 07:51 AM
Re: crontab
find / -name cron.allow -print to see which users have acess to the cron facilities. If there are users in the cron.allow these users will be allowed to make-modify their own cron entries.
In the same directory as the cron.allow is a cron.deny file. Users in this file do not have access to the cron facilities.
To create/modify cron entries, can use the 'crontab -e' command. This will place you in the crontab file for that particular user. Typically the EDITOR is vi so editing is done via the vi commands. Doing a :wq at the end of modifications will write the crontab file and the will be a message that states the cron will be using /bin/sh (something to that effect.)
Doing the modifications directly to the crontab files requires that the cron process be killed and restarted so that the modifications will be re-read. The 'crontab -e' command will automatically re-read the crontab file without having to bounce the cron process.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2000 07:51 AM
08-25-2000 07:51 AM
Re: crontab
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2000 08:27 AM
08-25-2000 08:27 AM
Re: crontab
# cd /var/spool/cron
# ls -al crontab.root
# cd crontabs
# cp /var/spool/cron/crontab.root
/var/spool/cron/crontabs/root
# vi root
[here i met an obtacle. how to add
modifications??]
--------------------------------------
my current screen (after 'vi root') is like:
# @(#) $Rivision: 72.1 $
#
# This is a sample crontab file for the super-user.
#
# log kernel diagnostic messages every ....
# sample nightly ......
# just uncomment .....
#0 4 *** exec /usr/bin/calendar -
~
~
~
......
------------------------------
if i can add modifications successfully, then i have to do this:
# /sbin/init.d/cron stop
# /sbin/init.d/cron start
# crontab -l
is that right??
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2000 08:37 AM
08-25-2000 08:37 AM
Re: crontab
Just enter:
crontab root
This kicks off the root file to run at the times scheduled within your 'root' cronfile.
You do not run cron stop or cron start.....the command crontab will execute the file you specify.
Regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2000 08:39 AM
08-25-2000 08:39 AM
Re: crontab
Tx,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2000 08:40 AM
08-25-2000 08:40 AM
Re: crontab
Next, if you editing the file with vi, the command to make a new line (below the cursor)
is the letter 'o'.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2000 08:47 AM
08-25-2000 08:47 AM
Re: crontab
however, my current screen after '#vi root'
is:
my current screen (after 'vi root') is like:
-------------------------------
# @(#) $Rivision: 72.1 $
#
# This is a sample crontab file for the super-user.
#
# log kernel diagnostic messages every ....
# sample nightly ......
# just uncomment .....
#0 4 *** exec /usr/bin/calendar -
~
~
~
"root" [Read Only] 11 lines, 342 characters
-------------------------------------
from this screen,
what do i have to add/modify ???
(for instance,
do i have to add something like this??)
====================================
# @(#) $Rivision: 72.1 $
#
# This is a sample crontab file for the super-user.
#
# log kernel diagnostic messages every ....
# sample nightly ......
# just uncomment .....
#0 4 *** exec /usr/bin/calendar -
root, oracle
~
~
====================================
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2000 08:58 AM
08-25-2000 08:58 AM
Re: crontab
minute hour day-of-month month-of-year day-of-week
minute 0-59
hour 0-23
day-of-month 1-31
month-of-year 1-12
day-of-week 0-6 (0 is Sunday)
Example
0 22 1-15 9 0 /usr/local/bin/
This says to run
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2000 09:01 AM
08-25-2000 09:01 AM
Re: crontab
can i see any detail sample (after added modifications) ?!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2000 09:10 AM
08-25-2000 09:10 AM
Re: crontab
To modify the cron, invoke the following command (using root account as example)
# crontab -e
This will place you in the crontab file for the root account.
Assuming that your editor is vi, the standard vi commands will allow you to make the modifications. After completion, use the vi commandd of ':wq' to write and quit the file.
To view the modifications, you can issue the command 'crontab -l'
Again, make a copy of the file before doing the making modifications.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2000 09:17 AM
08-25-2000 09:17 AM
Re: crontab
mm hh dm mo wd command
where
mm -2 digits for the minute that to what to have it executed(00-59)
hh -2 digits for hour (military time, e.g. 5 pm=17 (0-24)
dm-month day-2 digits -01-31
mo-month-1-12
wd-day of the week, 1-digit 0-Sun, 1-Monday, and so on (0-6)
Command- thatever command you like to execute.
See man crontab for details or crontab.root example.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2000 10:03 AM
08-25-2000 10:03 AM
Re: crontab
The above contributions are good. Create a cron.allow file in /var/adm/cron and include root, adm, uucp and any user name eg oracle.
Create your cron file with crontab -e.
Cheers!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2000 10:48 AM
08-25-2000 10:48 AM
Re: crontab
1)why i want to setup crontab?
- i downloaded and installed uvscan program
on this hp server box (for test purpose).
- i am able to run/scan that program, but
am unable to run automatically (ex: 9am in
mon thru fri, scan all files automatically)
- in order to run this file (uvscan)
automatically, i have to do something
first, and that is 'crontab'
2)what did i do for crontab setting?
- with friends' help, i did
# cd /var/spool/cron/crontab
# ls
[nothing is here]
# cd /var/spool/cron
# ls -al crontab.root
# cd crontabs
# cp /var/spool/cron/crontab.root
/var/spool/cron/crontabs/root
# vi root
[i added]
0 09 1,2,3,4,5 /usr/local/bin/uvscan
[then saved it]
# /sbin/init.d/cron stop
# /sbin/init.d/cron start
# crontab -l
3) i checked make sure uvscan is under
/usr/local/bin directory, and is there.
4) now, is this antivirus program (uvscan for unix/hpux server) will run everyday (mon-fri) at 9 am automatically ???
[sorry for my writing style....]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2000 10:52 AM
08-25-2000 10:52 AM
Re: crontab
0 9 * * 1-5 /
This would tell cron to run the command Mon-Fri at 0900 hrs.
If you would like to do the ranges, cron will accept the notation listed above.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2000 10:57 AM
08-25-2000 10:57 AM
Re: crontab
Try 0 9 * * 1-5 /usr/local/bin/uvscan.
Restart the cron daemon afterwords.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2000 11:23 AM
08-25-2000 11:23 AM
Re: crontab
# cd /usr/spool/cron/crontabs
# ls [checked root is there]
# vi root
[inside visual editor]
[modified to]
0 9 ** 1-5 /usr/local/bin/uvscan
[saved it]
# /sbin/init.d/cron stop
# /sbin/init.d/cron start
is this OK to run uvscan automatically ??
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2000 11:26 AM
08-25-2000 11:26 AM
Re: crontab
The system should return the line from crontab:
0 9 * * 1-5 /usr/local/bin/uvscan
And you be more than....
ps -ef | grep cron
If the process is running, it is ok.