Create a user Specfic CRON


 
Thread Tools Search this Thread
Operating Systems HP-UX Create a user Specfic CRON
# 1  
Old 03-14-2009
Create a user Specfic CRON

Hi there,
I have a small script that I need to run every hour and would like to schedule this a a cron job. I have tried running it in root but due to elm not being setup and file permissions it does not work unless it is ran from a specfic account. Is it possible to setup a user cron and how would I go about this..ie where is the con stored etc

Thanks in advance

colin
# 2  
Old 03-14-2009
log in as the user that needs to run the job, then create the cron job as that user
# 3  
Old 03-15-2009
users crontab

Quote:
Originally Posted by lodey
Hi there,
I have a small script that I need to run every hour and would like to schedule this a a cron job. I have tried running it in root but due to elm not being setup and file permissions it does not work unless it is ran from a specfic account. Is it possible to setup a user cron and how would I go about this..ie where is the con stored etc

Thanks in advance

colin
Hello,

log in as user and type:

crontab -e

will do the job !

Regards
# 4  
Old 03-15-2009
lodey,

1. you can login with the user ID to whom the file belongs to and have to schedule this job in crontab, however if you login as the user "you may not have access "for crontab.

2. if possible, change the owner of the file to root.

Try out.
# 5  
Old 03-15-2009
In Solaris there's a file called /etc/cron.allow that lists the users who are allowed to use cron. Chck for the existance of the same on your system, and add your user to the file. Then do the "crontab -e" via the user's shell, and create a crontab.
# 6  
Old 03-16-2009
Well all unix I know use can have cron.allow cron.deny at.allow etc... files...
In HP-UX if present , they should be in /var/adm/cron.
Giving rights to that user to use cron will also mean he can add or remove whats in it...
Why dont you use in your root cron file the su - <user> -c <command> ?

I tried in remote, and it works fine:
Code:
52 16 * * * remsh aco -l root -n "su - vbe -c ls">/home/vbe/cron.log 2>&1

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Need help to create cron job

Dear Experts, I want to create cronjob with the following steps: 1. go to directory /home/logs/ $cd /home/logs/ 2. copy to /tmp/ the most recent file with "prefix" local_data_ and sufix ".gz" ls -ltr drwxr-xr- 4096 Nov 24 2009 bak drwxr-xr-x 24096 Aug... (6 Replies)
Discussion started by: maxsub
6 Replies

2. Solaris

Particular user account shouldn't be locked after entering wrong passwd specfic no. times

Hi all In my system we have implemented user lockout feature after 3 failure attempt if he tries to login directly or if he run the any command through sudo and enter wrong password thrice. Now I have requirement in which particular user account shouldn't be locked when he run the command... (1 Reply)
Discussion started by: sb200
1 Replies

3. Shell Programming and Scripting

Does running a cron job of a user require the user to be logged in?

Suppose user 'asdf' is not logged into server 'bbbb', but the server is up. User 'asdf' has cron job. Will it be executed? (1 Reply)
Discussion started by: thulasidharan2k
1 Replies

4. Homework & Coursework Questions

Create script to add user and create directory

first off let me introduce myself. My name is Eric and I am new to linux, I am taking an advanced linux administration class and we are tasked with creating a script to add new users that anyone can run, has to check for the existence of a directory. if the directory does not exist then it has... (12 Replies)
Discussion started by: pbhound
12 Replies

5. Solaris

User entry in both cron.allow and cron.deny

Hello All, Anybody please help me to know ,what happens when a user having entry in both cron.allow and cron.deny files.Wheather the user will be able to access the crontab??? Thanks in advance Vaisakh (5 Replies)
Discussion started by: ksvaisakh
5 Replies

6. Shell Programming and Scripting

Re : How to create this cron job?

Hello All, Hope this finds you well. I am creating this shell script that will create cron jobs in crontab file. What I am provided with is the start time , intervals and # of trials. Based of Start time ( say 7:15 am ) and interval being 15 minutes, # of trial being 5 , I should create cron... (5 Replies)
Discussion started by: samshaw
5 Replies

7. UNIX for Advanced & Expert Users

cron cannot create the file.

#For the test1.sh crontab 35 11 * * * /home/tolamas/suru/MailingScript/test1.sh #test1.sh cat /home/tolamas/suru/reports/test11.res RCPT_LIST="st0030761@techmahindra.com" SUBJECT="test mail dated ${MAIL_DATE} " FROM="surekha.tolamatti@techmahindra.com" ( cat... (2 Replies)
Discussion started by: surekha268
2 Replies

8. Shell Programming and Scripting

cron cannot create the file..

#For the test1.sh crontab 35 11 * * * /home/tolamas/suru/MailingScript/test1.sh #test1.sh cat /home/tolamas/suru/reports/test11.res RCPT_LIST="st0030761@techmahindra.com" SUBJECT="test mail dated ${MAIL_DATE} " FROM="surekha.tolamatti@techmahindra.com" ( cat... (0 Replies)
Discussion started by: surekha268
0 Replies

9. Shell Programming and Scripting

How to create cron job automatically?

How do I write a perl script to get the cron jobs? I could do a perl -e ' system "crontab -l > jobs.txt " '; Is there a better way? Then I can use perl to make changes to jobs.txt. How can I submit the changes. I suppose I could use system "crontab jobs.txt", is there a better way? ... (0 Replies)
Discussion started by: siegfried
0 Replies

10. UNIX for Advanced & Expert Users

Other than root user .Normal user is unable to create files

Hi all, I am using Sun Solaris 9 .In this system normal users unable to create files from the command line.I added these users in bin,adm and even root group i found them unable to create a file. (1 Reply)
Discussion started by: mallesh
1 Replies
Login or Register to Ask a Question