I want to recrawl my sites 3 times a day. I know I should write a script for this but i don't know how? and i don't know how run the script ?
can someone explain this step by step
thanks
Write a shell script. Below structure can be used:
while loop
......command which u use to invoke nutch once
......sleep for few hours
end loop
Run this script using nohup or screen session. It will work great !!
Related
I have a server which needs a reboot every Sunday.
I have a python script I want to run in "tmux detached" automatically after each weekly reboot.
How can I automate this?
I guess it's a bash script with cronjob?
I have seen this: https://superuser.com/questions/440015/restore-tmux-session-after-reboot
But I can't get it to work. Maybe I am saving it as a wrong extension or something or maybe it just ain't working since it is 10 years old lol.
I haven't been able to find other resources, why I now ask.
Hopefully some of you are kind enough to help.
In advance, thank you!
I need to run a shell script that should interact with couple of servers / routers in daily schedule. The script will simply login to the remote end, run a command. Up to here i hear that you are saying it is easy. The real problem here is that i need to analyze the output of the first command and based on the output i need to organize the second command. This is also doable, but the situation here is that i do not want to login and logout from the box for every command.
What i need is to login once, stay alive ,run the command take the output, analyze it and then run the second command later on logout and close connection.
Correct me if i am wrong but expect is not an option here. I want to ask for your suggestions.
Which language / module of this language i can use to complete this requirement.
Environment is not pure ssh, so i should have something general that can be used for both ssh/telnet.
Thanks in advance
Since you mentioned python, pexpect should do the job pretty well:
https://pexpect.readthedocs.org/en/latest/overview.html
Trying to make a small script and cron job it in order to automate a task. Said script runs another script which has already been created, grabs the output, emails to specified recipients, and cleans up the output. I've got it almost down however am running into one major issue. The script that mine is running has a menu on the outset. That is to say, running the script by itself manually, i would have to select option 1 in order to get the output i want (the only other option, 2, is quit.)
How can I automatically enter (or simulate entering) the value 1 into the other script, so it does not hang when in a cron job waiting for user input?
Is there a sane way to do this?
Thanks in Advance.
You could try something as simple as using yes | command if answering yes is all that is needed. Otherwise you probably want to use expect to drive the imaginary keyboard for you.
http://expect.sourceforge.net/
Using autoexpect to record your session is a convenient way to come up with rough draft expect scripts as well.
I am working with a p4api.net application and I need to make use of perforce 'diff' command in it. I couldn't find a right approach to execute this command. I need a way to execute the command inside the application and get its result. Thanks in advance.
Without knowing what you've tried so far, or what the specific problem is, the best we can do is point you to the P4API.NET documentation for the diff method.
I have moodle installation on linux platform.
I want to set up a cron job for sending e-mails to users.
I've read about using crontab program and configuring it.
But according to my client requirements I want to execute it WITHOUT using crontab.
Can anybody help me on this?
Thanks in advance... :)
Have you tried while, loop?
Example:
while true;
do echo "Hello" ;
sleep 100;
done &
So you can enter your command / email script after do, or you can make a script for email process and called after do,
Note: kindly add end & symbol, so this will get execute in background.
Thanks.