LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Thread Tools
Old 11-04-2009, 11:16 PM   #1
stg_in2009
LQ Newbie
 
Registered: Jan 2009
Posts: 4
Thanked: 0
Executing perl script from all users login


[Log in to get rid of this advertisement]
Hi All,

I have a perl script that needs to be run from all Login users say once a week. How to accomplish this? I dont want this to run at startup. From crontab it needs to be set in each users login. Is there a better way to do this?
I require my perl script to run at particular time on every saturday from all login. Any workaround to this requirement?
Server OS: RHEL 3
Kindly guide me.

Thanks

STG

Last edited by stg_in2009; 11-04-2009 at 11:17 PM..
windows_xp_2003 stg_in2009 is offline     Reply With Quote
Old 11-05-2009, 06:49 AM   #2
centosboy
Member
 
Registered: May 2009
Location: london
Distribution: centos5/opensuse11
Posts: 581
Thanked: 69
Quote:
Originally Posted by stg_in2009 View Post
Hi All,

I have a perl script that needs to be run from all Login users say once a week. How to accomplish this? I dont want this to run at startup. From crontab it needs to be set in each users login. Is there a better way to do this?
I require my perl script to run at particular time on every saturday from all login. Any workaround to this requirement?
Server OS: RHEL 3
Kindly guide me.

Thanks

STG

Depends what the script needs doing. Maybe it could be run from roots crontab and just cycle via each users home dir??
Or just add the cron to a file in normal cron format, and then
use a for loop to add to the crontab of each user.
something like

Code:
for user in `command to list valid users`
do
crontab -u $user file
done

Few ways to do this...dpends on what the actual script running from the cron does...
windows_xp_2003 centosboy is online now     Reply With Quote
Old 11-05-2009, 10:25 PM   #3
stg_in2009
LQ Newbie
 
Registered: Jan 2009
Posts: 4
Thanked: 0

Original Poster
Hi,
Thanks centosboy for your valuable reply.
Actually I have a perl script that checks for ClearCase views and deletes view-private files in it. This way it is possible to cleanup the ClearCase views. But the issue is, the ownership of all the view-private files in the ClearCase views are with the users who creates it. So, if I run this script from root it will not delete them.
I think to complish this, I have 2 options:
1. I have to have 2 scripts. First script changes the mode to 777 for all view-private files from the users login and then run another script (my present script) from root to actually delete them.

2. Else run this script from all login users without their knowledge. This will cleanup all the views in our setup. This is my goal.
The script is already ready but I am struck on how to implement it.

Any suggestion would be of great help.

Thanks again.
Regards

STG
windows_xp_2003 stg_in2009 is offline     Reply With Quote
Old 11-06-2009, 02:16 AM   #4
chrism01
Guru
 
Registered: Aug 2004
Location: Brisbane
Distribution: Centos 5.4
Posts: 7,439
Thanked: 326
Given the 1st Perl script runs a root, it's got enough access/power to chmod the files, then delete them.
http://perldoc.perl.org/functions/chmod.html
windows_xp_2003 chrism01 is offline     Reply With Quote

Reply

Bookmarks


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Instead of executing perl script,Mozilla Firefox opens it,why? mq15 Linux - Server 13 10-07-2009 10:42 AM
Executing Perl Script TalkingMarble Linux - Newbie 4 08-05-2008 09:33 AM
Executing unix commands from perl script running on Windows. harishkrishnan Programming 1 03-05-2008 12:48 AM
executing perl script through .forward file skverma_in Linux - Newbie 3 10-21-2004 08:24 AM
executing perl script through .forward file skverma_in Linux - General 0 10-18-2004 06:06 AM


All times are GMT -5. The time now is 03:02 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
RSS2  LQ Podcast
RSS2  LQ Radio
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration