As a service to the public i translated the first three posts to english. I hope you all understand the rule, which ensures that the biggest possible share of users can participate in the forums. Like it or not, English is the de facto lingua franca of the internet.
i try to insert a line in crontab to start a script for my Anti-Flood-tool after every boot of the server. Unfortunately i am not all too knowledgable about Linux. Maybe someone could help me?
Thanks a lot in advance.
---> The entry i wrote:
I use a similar line to start the Ts which is working flawlessly
Please post the complete crontab-entry.
Additionally the leading fullstop:
should be deleted.
Which shell do you use?
---------- Post updated at 09:25 AM ---------- Previous update was at 09:24 AM ----------
Unfortunately i don't know how to find which shell i use. I have to admit .... i have to learn a lot still ... haven't much experience with Linux up to now. :-(
Now to the problem itself:
I don't know Linux all too well, but crontab is not the place to do things based on a event, like a reboot. crontab is for doing things repetitively based on time: if you want to run a script every 5 minutes or every third monday in a month or everyday at 5:00 pm, you use cron. In your case you use a "rc-script". The basic design is like that: your system has several different "runlevels" - modes of operation. One runlevel is a single-user mode without any networking, wich is used to debug the system if things went really, really bad. Another runlevel is multi-user, full network, but no graphical login, which is good if your graphics adapter is broken and you have to log on over the network. Read more about runlevels in your man pages.
To change from one runlevel to another there is a command ("telinit"). When this command is issued the following happens: all the services started in this runlevel are stopped (killed), then the runlevel is switched and all the services in the new runlevel are started. Because at boot time there has to be some runlevel initialized all the start-scripts for this runlevel are executed. This stopping/starting is done via so-called "rc-scripts", which reside in "/etc/rc[n].d", where [n] is the number of the runlevel. all these scripts work the same way: they understand a single parameter, which can be "start", "stop" (or "restart").
Here is a basic layout for such an rc-script:
You could put your command in there instead of in the crontab and it should work. That is: if your command would be correct, which it isn't.
If you use a relative path like "./somewhere" you depend on a specific context: your session has a working directory, in which a directory named "somewhere" resides. If you would change into this directory the path "./somewhere" would not make sense any more, right? When this script is executed (and this is true for crontab scripts alike) there is no such thing as context, because this is not your session any more, but a different one - hence, use absolute paths always!
Furthermore, you might have set environment variables your application depends on. Be aware that these won't be set in an rc-script either. You have to set them there explicitly to be able to use them there. Issue an "env" and analyze the output to find out if this is true for your app.
I have installed on my MacBookPro Ubuntu via Boot Camp, but bootcamp has deletet that MacOS partion and created just one new and installed ubuntu.
Now I can not install MacOS 10 from the DVD, the gray screen comes when I use the "C" key during the boot process. it starts booting... (2 Replies)
unter Suse Linux 11.2 / Kubuntu 10.04 habe ich mir ein Service-Menü angelegt.
Bis auf das Nachfolgende funktioniert alles bestens.
Bisher habe ich auf der Konsole mit dem Programm pdftk Anhänge an ein Pdf-File erzeugt.
Der Code lautete
pdftk beispiel.pdf attach_files Anlage1.pdf... (1 Reply)
ich habe folgende Dateien:
Davon allerdings hunderte.
Wie lautet der Befehl um diese Dateien umzubenennen in
also ohne die Endung und ohne den Punkt?
Weiß einer was????? (1 Reply)
I have an entry in the cron file.
10 3 * * * /usr/bin/test.sh
I want to change it to:
00 11 * * * /usr/bin/test.sh
how to do this without entering the crontab file and edit the change?
thank you (5 Replies)
I've a shell script which calls a Sybase stored procedure to do some functionality. I want to schedule the running of this script by crontab. I'm using Solaris 5.8. When i executed the following command
i got the output as
crontab: can't open your crontab file
How... (10 Replies)
i have a ksh script that creates messages in a temp directory and then sends them out using the sendmail command and i'm trying to set it up to run every night with crontab.
So the basic gist of the script is
#create temp dir and messages
#loop through each message and send using sendmail... (3 Replies)
Please help me in understanding the crontab entries and also below queries
1. how can we set a crontab entry
2. from where the cronjob will run( if default)
3. you can we specify the location from which the cronjob should run.
4. how can we capture the output of the cronjob.
... (8 Replies)
I have a shell script which works fine at the command line
and does works in crontab also but does not send the output to
mail as other scripts do by default.
10 1 * * * /export/home/test/report_script
by default should send the output to mail but the script
runs OK and the output... (1 Reply)