Talking about the difference of Linux configuration timing, using CRONTAB-E and direct edit/etc/crontab _linux

Source: Internet
Author: User
Tags rsync

Linux Configuration timed task, we all know the use of crontab this system function, but sometimes we need to distinguish user execution, the following directly say the difference between 2 methods:

Method 1:

Use the command crontab-e and then edit the timed script directly.

After this implementation, the user-defined, will be written to the/var/spool/cron directory, to generate a consistent user name file, the file content is our edited timed script.

Such as:

[Root@localhost cron.d]# Cd/var/spool/cron
[root@localhost cron]# ll
total dosage 4
-rw-------. 1 root root 52 December 9 1 0:58 root
[root@localhost cron]# pwd
/var/spool/cron
[root@localhost cron]# cat Root 
* * */root/au tomysqlbackup.sh

Method 2:

Use the command Vi/etc/crontab to edit the timed script.

Such as:

[Root@localhost ~]# Cat/etc/crontab S Hell=/bin/bash path=/sbin:/b                                                                                                
In:/usr/sbin:/usr/bin Mailto=root                                                                                                  
                                               home=/                                                                                                
# Run-parts                                                                              
* * * * * root/usr/sbin/ntpdate 210.72.145.44                                                    #30 8 * * * root/usr/sbin/ntpdate 132.228.90.101                         
* * * * Root run-parts/etc/cron.hourly                                                                                 
4 * * * Root run-parts/etc/cron.daily                                                                                
4 * * 0 root run-parts/etc/cron.weekly                                                                                
4 1 * * Root run-parts/etc/cron.monthly                                                                     
*/1 * * * * Root run-parts/opt/openoffice.org3/program/start.sh                                                                               
############################################ 4 * * * * ROOT/USR/BIN/RSYNC-VZRTOPG--progress--delete root@192.168.231. 35::resource/hyy/bak/resource 4 * * * ROOT/USR/BIN/RSYNC-VZRTOPG--progress--delete root@192.168.231.35::log/hyy/ Bak/log ############################################ [Root@localhost ~]# 
 

(System level) do system-level configuration we will directly configure/etc/crontab

(User-level) is generally recommended to use CRONTAB-E, so the system will also help check our configured script syntax.

This article discusses the Linux configuration timing, the use of crontab-e and direct editing/etc/crontab is the difference between the small series to share all the content, I hope to give you a reference, but also hope that we support the cloud habitat community.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.