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
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
Where cron file for user and for root is saved after executing
crontab -e
and saving data?
/var/spool/cron/username
Use su to access the file.
Each user can have their own crontab, and these files are in /var.
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
We can use the chage command to update the PASS_MAX_DAYS(maximun number of days a password may be used) of a user.
Does linux provide some command or solution to manage this on group level?
For example, The PASS_MAX_DAYS of group user is 30 days. This means all the users in user group should change their password in 30 days?
for member in `groupmems -g YOUR_GROUP_NAME --list`;do chage -M 30 $member ;done
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 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