LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   Adding job from a script(Custom built RPM) (http://www.linuxquestions.org/questions/programming-9/adding-job-from-a-script-custom-built-rpm-867851/)

glennt11 03-11-2011 12:17 AM

Adding job from a script(Custom built RPM)
 
SO I'm checking in after all these years away to see if anyone has a better way of doing this...

I'm building an RPM that requires adding a cron job into a user's(service account) crontab...from what I see in the manpages, this isn't possible, as the only viable option is to replace the crontab entries already there for previous scripts being run...

Either way, as an example I've found I can make it work by directly modifying the crontab file using:

Code:

echo "* * * * * /bin/ls -la ~/ >> ~/ls.log" >> /var/spool/cron/userName
I'd just like to know, is there any MAJOR issues with modifying a the crontabs like this?

This is running on a Redhat Enterprise Linux server by the way...

mesiol 03-11-2011 06:04 AM

Hi,

i did nearly the same in my rpm's for years without any problem. I cannot see any issue.

Test1 09-28-2012 03:57 AM

@mesiol : Can you please share the script how you are doing it with RPM?


All times are GMT -5. The time now is 07:39 AM.