task - is doing linux timed execution tasks

While doing linux timed execution tasks, I found that this command was not found, so I needed to install it. The installation steps are as follows:

[root@dzwww ~]# yum install -y vixie-cron

....

Installed:

  vixie-cron.i386 4:4.1-81.el5                                                                                                                                         

Complete!

After the installation is complete, start the service:

service crond start

Restart the service:

/sbin/service crond restart or /etc/rc.d/init.d/crond restart

 

crontab -u //Set the cron service of a user, generally the root user needs this parameter when executing this command

crontab -l //List the details of a user's cron service

crontab -r //delete a user's cron service

crontab -e //Edit a user's cron service

  

//For example, root checks its own cron settings

crontab -u root -l

Configuration file directory /var/spool/cron

  

//Execute mysqlback.sh at 12:00 every day

 

vi /etc/crontab

 

00 12 * * * root /usr/local/mysqlback.sh

 

 

00 10 * * * root /data/db/backup/backup.sh #10 AM

 

00 01 * * * root /data/db/backup/backup.sh #3AM

 

 

 vi backup.sh

rq=` date +%Y%m%d%H%M%S`

mysqldump -uroot -paaa dddsdudb>/data/db/backup/abc_$rq.sql

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326198051&siteId=291194637