vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| contracer11@gmail.com wrote: > Hi: > > Can you tell me if is there any way to make this task ? > > > 00 1 * * * /monitor_file_system 2>/dev/null > crontab > > Thank You ! man crontab I think the -e switch does what you want. |
| |||
| ยท contracer11@gmail.com <contracer11@gmail.com>: > > Hi: > > Can you tell me if is there any way to make this task ? > > > 00 1 * * * /monitor_file_system 2>/dev/null > crontab Certainly. This can be done. My solution would be dump the whole crontab, echo the line you need and feed all of that back to crontab. man crontab and man sh for the details. Michael Schmarck -- Politics makes strange bedfellows, and journalism makes strange politics. -- Amy Gorin |
| |||
| On Apr 9, 2:17*pm, contrace...@gmail.com wrote: > Hi: > > Can you tell me if is there any way to make this task ? > > 00 1 * * * /monitor_file_system *2>/dev/null *> crontab > > Thank You ! If you are trying to do this manually and know vi, export EDITOR=/usr/bin/vi crontab -e then add your entry then save / quit If you are trying to do this from a script, 1. dump the content of the existing crontab to a file # crontab > /tmp/dump 2. echo "your lines" >> to the corntab file # echo " 00 1 * * * /monitor_file_system 2>/dev/null" >> /tmp/dump 3. import the new crontab # crontab /tmp/dump |
| |||
| On Apr 9, 4:58*pm, Sharif Rizal <sharif.ri...@gmail.com> wrote: > On Apr 9, 2:17*pm, contrace...@gmail.com wrote: > > > Hi: > > > Can you tell me if is there any way to make this task ? > > > 00 1 * * * /monitor_file_system *2>/dev/null *> crontab > > > Thank You ! > > If you are trying to do this manually and know vi, > > export EDITOR=/usr/bin/vi > crontab -e > > then add your entry then save / quit > > If you are trying to do this from a script, > 1. dump the content of the existing crontab to a file > * # crontab > /tmp/dump > 2. echo "your lines" >> to the corntab file > * # echo " 00 1 * * * /monitor_file_system *2>/dev/null" >> /tmp/dump > 3. import the new crontab > * # crontab /tmp/dump correction: 1. dump the content of the existing crontab to a file # crontab -l > /tmp/dump |
| |||
| On 9 abr, 17:59, Sharif Rizal <sharif.ri...@gmail.com> wrote: > On Apr 9, 4:58*pm, Sharif Rizal <sharif.ri...@gmail.com> wrote: > > > > > > > On Apr 9, 2:17*pm, contrace...@gmail.com wrote: > > > > Hi: > > > > Can you tell me if is there any way to make this task ? > > > > 00 1 * * * /monitor_file_system *2>/dev/null *> crontab > > > > Thank You ! > > > If you are trying to do this manually and know vi, > > > export EDITOR=/usr/bin/vi > > crontab -e > > > then add your entry then save / quit > > > If you are trying to do this from a script, > > 1. dump the content of the existing crontab to a file > > * # crontab > /tmp/dump > > 2. echo "your lines" >> to the corntab file > > * # echo " 00 1 * * * /monitor_file_system *2>/dev/null" >> /tmp/dump > > 3. import the new crontab > > * # crontab /tmp/dump > > correction: > 1. dump the content of the existing crontab to a file > * # crontab -l > /tmp/dump- Ocultar texto entre aspas - > > - Mostrar texto entre aspas - Is there any way to issue this command ? rsh machine01 00 1 * * * /monitor_file_system 2>/dev/null > crontab I need put this entry in 30 machines... Thanks... |
| |||
| On Apr 10, 2:36*pm, contrace...@gmail.com wrote: > On 9 abr, 17:59, Sharif Rizal <sharif.ri...@gmail.com> wrote: > > > > > On Apr 9, 4:58*pm, Sharif Rizal <sharif.ri...@gmail.com> wrote: > > > > On Apr 9, 2:17*pm, contrace...@gmail.com wrote: > > > > > Hi: > > > > > Can you tell me if is there any way to make this task ? > > > > > 00 1 * * * /monitor_file_system *2>/dev/null *> crontab > > > > > Thank You ! > > > > If you are trying to do this manually and know vi, > > > > export EDITOR=/usr/bin/vi > > > crontab -e > > > > then add your entry then save / quit > > > > If you are trying to do this from a script, > > > 1. dump the content of the existing crontab to a file > > > * # crontab > /tmp/dump > > > 2. echo "your lines" >> to the corntab file > > > * # echo " 00 1 * * * /monitor_file_system *2>/dev/null" >> /tmp/dump > > > 3. import the new crontab > > > * # crontab /tmp/dump > > > correction: > > 1. dump the content of the existing crontab to a file > > * # crontab -l > /tmp/dump- Ocultar texto entre aspas - > > > - Mostrar texto entre aspas - > > Is there any way to issue this command ? > > rsh machine01 00 1 * * * /monitor_file_system *2>/dev/null *> crontab > > I need put this entry in 30 machines... > > Thanks... You can't send it directly to crontab. If you want to run this cron as root, you'll need to send it to /var/spool/cron/crontabs/root. Be careful with the ">". This will overwrite your existing cron entries. Use ">>" instead! man sh for more details. Also try these man pages: cron, crontab I'm not sure if this will work. Give it a try... rsh machine ""01 00 1 * * * /monitor_file_system 2>/dev/null" >> / var/spool/cron/crontabs/root" |
| |||
| On Thu, 10 Apr 2008 13:01:47 -0700 (PDT), Sharif Rizal wrote: > > You can't send it directly to crontab. If you want to run this cron as > root, you'll need to send it to /var/spool/cron/crontabs/root. > Be careful with the ">". This will overwrite your existing cron > entries. Use ">>" instead! man sh for more details. Solaris cron won't pick up a crontab changed like that until someone performs a change via crontab or cron is restarted. Helmut -- Almost everything in life is easier to get into than out of. (Agnes' Law) |
| |||
| On Thu, 10 Apr 2008 21:56:18 +0000 (UTC) Helmut Kreft <kreft@unfug.org> wrote: > On Thu, 10 Apr 2008 13:01:47 -0700 (PDT), Sharif Rizal wrote: > > > > You can't send it directly to crontab. If you want to run this cron > > as root, you'll need to send it to /var/spool/cron/crontabs/root. > > Be careful with the ">". This will overwrite your existing cron > > entries. Use ">>" instead! man sh for more details. > > Solaris cron won't pick up a crontab changed like that until someone > performs a change via crontab or cron is restarted. Easy enough to issue `EDITOR=touch crontab -e` afterwards. -- Andrew Deason adeason2@uiuc.edu |
| ||||
| On Wed, 9 Apr 2008 11:17:47 -0700 (PDT), contracer11@gmail.com wrote: > > Hi: > > Can you tell me if is there any way to make this task ? > > > 00 1 * * * /monitor_file_system 2>/dev/null > crontab > crontab -l | (cat;echo "00 1 * * * /monitor_file_system") | crontab Helmut -- Almost everything in life is easier to get into than out of. (Agnes' Law) |