Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
You would really do yourself a favour by search for standard reference documentation about things like this. There is a huge amount of information about cron, and most of it says that it's really basic, as it is. for example http://en.wikipedia.org/wiki/Cron tells you everything you'd ever need to know.
Well I am supposed to be putting together a web server in which people can sign up and create accounts to host websites from, a sort of free web host package system. But at the moment I want apache to have a crontab that runs every few minutes to make new users from a text file. Does it matter what user it's related to? Or can I just make my own user account do the cron? Apologies if I am not making sense.
Well I am supposed to be putting together a web server in which people can sign up and create accounts to host websites from, a sort of free web host package system. But at the moment I want apache to have a crontab that runs every few minutes to make new users from a text file. Does it matter what user it's related to? Or can I just make my own user account do the cron? Apologies if I am not making sense.
It doesn't matter which user you use, so long as they have the rights to do whatever it is that's involved in creating the users. You want to do a fair bit of sanity checking on the text file, and you _really_ don't want to go for root reading and acting on that text file.
I do it through a setuid'd script.
(onebuck: I was aiming at the post above yours)
Last edited by Lordandmaker; 10-19-2009 at 09:51 AM.
Right, so I can have my own user account do the cron script. Cool.
Any by setuid'd you mean?
I've only just about worked out how to view the crontab, now Im working on making it do something as a test! Not getting far!
Edit: Ok i've managed work out to how to create a cron file for my user, however it doesn't appear to work. Most likely my syntax, could I have some suggestions as to what is wrong the following.
Quote:
5 * * * * cat > /home/gary/test.txt more lines to be added
That is supposed to put the text "more lines to be added" into the text.txt file, which is stored in my home directory every five minutes. However it's not.
1. cron has a minimal env, so always use complete absolute paths to all cmds/files referenced.
2. You cat the contents of a file, you 'echo' strings, so your cmd would normally be more like
echo "some string here" >> /home/you/file.txt
However, you wouldn't put that in a crontab. The best thing to do is write a shell script and call that from cron.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.