Ref: "build crontab from a text file" in same forum. (I am not allowed to post URL's in the first post)
We are reorganizing our UNIX Crontab file by first making changes in a word pad text file. The intent is to then copy it back to Crontab. Will this work? Copy and Paste does not seem to work.
From the crontab man page -
Code: So, something like this:
Code:
will have to have ALL of the entries needed from the old crontab, because this wipes all of the lines in the existing crontab file.
-----------------------------
My script does many actions as root. A part of this script is to add a new crontab entry for a normal user.
I used this method and now need to transfer "mynotepadfile" to crontab of "myuser". But the method "crontab [file]" only works for the user invoking it. So this will edit root's crontab, but not someone else's. At the same time, the whole script cannot be executed as non-root.
How would the syntax "cat mynotepadfile | crontab -" change?
It'd be better just to edit it on the UNIX system with crontab -e -- typing text into a black window really isn't that different than typing text into a white one.
If you insist on a solution that edits in windows, you don't need to redirect the file into crontab when you give it a file name:
Be very very sure that you're not giving cron a file filled with garbage carriage returns after you've edited it on windows! Windows text files are not the same as UNIX ones, Windows uses \r\n in the CPM/DOS tradition.
But I did a mistake by referring another thread, as I created an impression that I am working in Windows. There is no Windows system in the picture. I would like to clarify the situation. The system runs on AIX. I referred to the thread because I got this when I searched a solution for this issue.
My requirement is to run a script as root, which adds a job to a normal user's cron file.
But the constraints are:
1)Other portions of the script needs root privileges. So normal user cannot execute it.
2)It is not possible to manually edit cronfile, because this and other steps should be part of a big script that would be executed on a number of systems.
3)Root cannot give the command
(where /tmp/tmp_cronfile contains the text to add the job to the normal user's cron file)
because this command ends up in changing root's cron file and not the normal user's cron file.
The command
will also not help for the same reason.
My question is how to modify the above command in such a way that it modifies a normal user's cron file, even while running as root.
Is it something to do with the -l or -u flags of the crontab command?
Hi!! one strange problem occurred with my RHEL 5 box.
i'm having logs folder with ownership of non-root user. Created some files with root user under logs folder.
here is the scene:
-rw-r----- 1 root root 1048227 Feb 28 12:34 SystemOut_13.02.28_12.34.10.log
-rw-r----- 1 root root ... (6 Replies)
Hi everyone,
I got error which is "!bad user (root)" in crontab...
I tried changing password,
I checked etc/cron/cron.allow and cron.deny,
And also I checked the permissions of my files,
its(my crontab script) still not working....
Please help... (12 Replies)
I've been through many threads before i decide to create a separate thread.
I can't really find the solution to my (simple) problem.
Here's what I'm trying to achieve:
As "canar" user I want to run a command, let's say "/opt/ocaml/bin/ocaml" as "duck" user.
The only to achieve this is to... (1 Reply)
Hi all,
I am trying the following
I am hoping that the crontab would be changed.
but it prints the previous crontab and says
Can anyone tell me the correct ksh command that should be used here?
I don't want to edit the crontab with crontab -e, I need to edit it via ksh.
Thank... (2 Replies)
I'm using fedora 5 and sql 5.0. I'm trying to edit the crontab to perform automatic backups of my database. For some reason it isn't working. Here is what I have so far.
15 2 * * * /usr/bin/mysqldump -opt -all-databases u root -ppassword -h localhost... (10 Replies)
I want to set up a file with crontab to run the cron deamon so I can use at to schedule jobs. I think the crontab file (or whatever you call it) has to be set up. Currently, I don't have a crontab file (I checked by typing sudo crontab -u myusername -l), and I don't know the syntax for creating... (6 Replies)
Hello,
I seem to be having a problem with accumulation of root CRON jobs occuring when I have a user's cron job(s) running.
Here is an example of a user's crontab file:
*/1 * * * * echo "hello" > /dev/nullps aux|grep CRON
root 14333 0.0 0.0 91236 2172 ? S ... (12 Replies)
Good morning everybody. I have just receiedv a complaint from our DBA saying that if he create a scripts to run some Oracle performance scripts using crontab and the scheduling part is ok but the job is failed when I checked on /var/adm/cron/log.
I have tried his scripts using Oracle id directly... (4 Replies)
Does anyone know if this is possible?
I want to give some users access to root's crontab but only with a read privilege.
Is this possible to do or can only root or people with full root sudo view root's cron? (4 Replies)
Hi
I am not able to edit crontab.
Following is the comand that is being issued
$crontab -e
2764 ............ This is what I am able to see
But when I do
$crontab -l
List of all the crontab entry is displayed.
Also I am seeing one entry in my /etc/cron.d
prw------- 1 root ... (6 Replies)