Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I am using sphinx for searching. I get new data everyday which is added in the database.
I have to add this data into the sphinx search index so that it can be searched. For that I need to reindex the sphinx search index at regular intervals.
How can I set a cron in linux to do so?
a crontab is defined like this:
MIN HOUR DOM MON DOW CMD
so if you want to run a task on a daily basis try:
0 0 * * * /path/to/your/script
that will trigger the launch of your script everyday at 0:00
For more details, see the cron tag wiki
Related
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
This is the current running cronjob :
2 1 * * * cd /var/www; php auto.php
that says it will be run everyday # 1:02 AM ... How can i make it to run # 1:02:05 everyday?
It's not possible as the cron can only run in minutes interval at minimum.
What you can do to achieve the same effect is to have delay in your script as the fist line:
sleep(5); // sleep for 5 seconds
This way the script actually starts at 1:02:05.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
My application is running on Linux server, Every three or four days, server time and EST time have different between 2 to 40 seconds. Is there any way to keep sync timing with NTP on daily basis.
The application is running 24X7, so can't reboot everyday to sync. Right now we are manage this problem by set time manually.
Thanks and appreciate.
Add a simple cron job to run ntp at whatever time you wish.
#Set time
0 0 * * * /usr/sbin/ntpdate ntp2.ja.net
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I would like to schedule a cron to take backup of my database every three days at mid-night.
So, is this correct?
0 0 */3 * * /usr/bin/mysqldump -hhost_ip -uusername my_db_name -ppassword > my_backup.sql
This question might have asked earlier, but I just want to confirm this.
Thanks. Any help would be of immense help!
no.
you miss user
# m h dom mon dow user command
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
In a crontab file, should commands be specified with a trailing "&", or will the command run in the background anyway?
I have:
*/20 * * * * /home/me/monitor/check.sh /home/me/monitor/check.properties >> /home/me/monitor/check.log 2>&1 &
I've seen contradictory answers to this question in various places. Some say no need to put an "&", others that without the ampersand cron waits for output from the command, even though all output is redirected.
Every job that's run by cron is run in the background automatically, so no need for the &
See this too.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I need to install some cron jobs with my Ubuntu installation package. The ones that run every day or hour are easy: I can just create a symlink from /etc/cron.daily to my script.
However, I also have a script that I would like to run every 10 minutes. There is no such thing as /etc/cron.minutely. Also I am not sure how to edit crontab without using the interactive editor (crontab -e). What is the best way to go about this?
Your package can simply put a file in /etc/cron.d/
The text file should contain something like this, to run a command every 10 minutes:
*/10 * * * * root /path/to/command
Google 'cron format' for more info, and yes, this belongs in askubuntu or superuser.
You need to add the username (root) to the line, as shown above. Apparently this is necessary for files in cron.d, but I can't find a definitive document.**
cron should pick this new job up automatically.