- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- adding a script to cron
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
02-13-2001 08:38 AM
02-13-2001 08:38 AM
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2001 08:48 AM
02-13-2001 08:48 AM
Re: adding a script to cron
You should use 'crontab -e' to modify the crontab.
You should run it as a user who has read/write access to the files and the directory where your compressed files will be (same as uncompressed dir, if you run gzip without extra flags)
If you run it as root, make sure nobody has write access to your script, as this could lead to a major security issue.
Best regards,
Dan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2001 08:49 AM
02-13-2001 08:49 AM
Re: adding a script to cron
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2001 08:52 AM
02-13-2001 08:52 AM
Re: adding a script to cron
Use "crontab -e" to modify your cron jobs and "crontab -l" to list your cron jobs under your userid.
It ownership of the crontab matters because only the cron jobs under the owner's crontab have the rights to modify files under his ownership.
man crontab (1) for more information on how to set the schedule. Briefly the syntax for an entry in the crontab is:
minute hour day-of-month month weekday command eg.
0 0 * * * /tools/compress.sh
to run the compress.sh script everyday at midnight.
Hope this helps. Regards.
Steven Sim Kok Leong
Brainbench MVP for Unix Admin
http://www.brainbench.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2001 08:57 AM
02-13-2001 08:57 AM
SolutionAn easy way is to use SAM -> Process Management -> Schedule cron jobs.
You also can use crontab for it. With "crontab -e" you can edit your crontab file. A line of such an crontab file has the follwing format: "minute hour monthday month weekday command". See man-pages.
If you want to use cron as user you have to make sure that you are allowed to do it (try "crontab"). The permission are determined by the files /var/adm/cron/cron.allow .../cron.deny.
Hope this helps.
Thomas
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2001 09:16 AM
02-13-2001 09:16 AM
Re: adding a script to cron
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2001 06:45 AM
02-14-2001 06:45 AM
Re: adding a script to cron
I wrote a similar script for taring (compresing) my passwords directory, this is helpful because I have a recovery site, and the passwords somethimes are not the same In my production server.
To edit the crontab, just type this:
crontab -e
e: means edit, l: list,
Then add this line at the end of the file(go to the vi reference manual, cause it uses vi to edit the file).
typing i (insert).
00 23 * * * /usr/bin/ksh /scripts/passwords.ksh
This means that every day at 23:00 P.M executes using the shell ksh my script passwords.ksh located in /scripts/ if you have trouble understanding the date, just do a man crontab and you will see some help.
Hope this helps