Cron issue while renaming a username

 
Thread Tools Search this Thread
Operating Systems Linux Red Hat Cron issue while renaming a username
# 1  
Old 03-22-2010
Cron issue while renaming a username

Hi All;

I have a to rename a user account example User1 to User2 keeping everything same.

Now I would be using

usermod -l User1 User2 .However User1 has some cron jobs and by using the conventional usermod iam unable to transfer those cron jobs to User2 i.e after renaming the user.

Gone through MAN page
CAVEATS

"You must change the owner of any crontab files manually".
Is there any work around.

Thanks in Advance
Syed
# 2  
Old 03-22-2010
there are 2 work arounds possible..

1. find out the cron system file of user1 and make it as user 2.


2. else list out the cron entries of user1 and then redirect it to user2 as
Code:
crontab -l -u user1 | crontab -u user2 -

# 3  
Old 03-22-2010
Thanks thegeek i did it the second way.Smilie
# 4  
Old 03-22-2010
oops, also ensure that you have removed the user1 cron jobs.
# 5  
Old 03-24-2010
Done that....and thank you...once again,Well i had numerous users so i wrote something to move the files in /var/spool/cron/ to new user names and simultaneously did chown on them.It worked fine.Smilie

Regards,
Syed
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Cron issue

i have written a script to sftp yesterday's logs from another server as below: cd /export/home/abc/xyz/tt d=`gdate -d'yesterday' +%Y%m%d` sftp abc@XXX.XX.XX.XX<<EOF cd /yyy/logs/archive mget abc.log.$d* EOF cd /export/home/abc/xyz/scripts nohup ./ss.sh PROD & it is working fine... (2 Replies)
Discussion started by: ssk250
2 Replies

2. Solaris

CRON Issue

Hello, I am running Solaris 8. I have set a cron job that runs every couple hours. If I run the script manually, it runs just fine (logged in as root). The cron however will not run. It is producing an rc=1 error. Any thoughts would be appreciated. Thanks (4 Replies)
Discussion started by: jkmtm
4 Replies

3. Ubuntu

Cron Issue

I have written a custom cron. This cron executes a rake task every 5 minutes. I also log the trace of this execution in a file locally on my server. The whole process seems to execute seamlessly every 5 minutes, but then it seems to log it in /var/log/syslog. I investigated on the syslog and found... (3 Replies)
Discussion started by: manjunath.nm89
3 Replies

4. Shell Programming and Scripting

Issue with Cron

Hi Gurus, I need to run a script every saturday at 7:05 PM. Below command is working in x86_64. 05 19 * * 6 /apps/informatica/scripts/inf_rest.ksh However when I tried in HP-UX it is giving the below error. crontab: error on previous line; unexpected character found in line. Please... (4 Replies)
Discussion started by: svajhala
4 Replies

5. Shell Programming and Scripting

A Cron Issue

Hi Guys.,, This thing is driving me crazy.. I have this script which runs perfectly fine. If it is not able to connect to database it will drop a mail which it does when i ran it manually. But when i am running it from crontab, the script is not sending mail to me but to my id(login id)... (0 Replies)
Discussion started by: mac4rfree
0 Replies

6. Shell Programming and Scripting

Issue with File Renaming

I am trying to perform some validations on the source files. the script has file name pattern as an argument.The Input file has Single quotes in the filename . I want to remove those single quotes and split the file into 2 parts. below is my code FILE_NAME=$1 if then echo "\n Files are... (5 Replies)
Discussion started by: dsshishya
5 Replies

7. UNIX for Dummies Questions & Answers

Renaming Issue..

Hi guys.. Please help me.. I am a newbie to Unix.. How to change the extension of all .txt files in my current directory and also subdirectories to .my extension all together?? Regards, Mahesh.. (2 Replies)
Discussion started by: mraghunandanan
2 Replies

8. Red Hat

cron issue

Hello, Having and issue with a job scheduled in cron. The script: #!/bin/bash 2 3 # Example shell script which can be added to roots cron job to check the 4 # Embedded Satellite disk space usage. If any table is over 90% usage, send 5 # a notice to the default email address... (2 Replies)
Discussion started by: mgb
2 Replies

9. UNIX for Dummies Questions & Answers

Another Cron issue.

Hey guys, I have a script called my_test: # !/usr/bin/sh `touch /usr/test/me` The script has been saved in /usr/test/my_test I have executed chmod 755 /usr/test/my_test Then I have entered it into the cron file using crontab -e 0,5,10,15,20,25,30,35,40,45,50,55 * * * * /usr/test/my_test... (2 Replies)
Discussion started by: Beefy
2 Replies

10. UNIX for Advanced & Expert Users

cron issue

user x has a cron job that looks in a dir and moves teh files from 1 name to another except its not working correctly. . /user/.profile # sorce the users profile for file in `ls`; do mv $file $file.`date +%Y%m%d%H%M%S``microsec` done microsec is a binary with 555 perm. on it in... (5 Replies)
Discussion started by: Optimus_P
5 Replies
Login or Register to Ask a Question