Linux configuration timing, the difference between using CRONTAB-E and direct edit/etc/crontab

Source: Internet
Author: User


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

Method 1:

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

After this execution, the user-defined, will be written to the/var/spool/cron directory, generate a file with the user name consistent with the file content is our editor's timed script.

Such as:

[[email protected] cron.d]# Cd/var/spool/cron[[email protected] cron]# ll total dosage 4-rw-------. 1 root root 52 December  9 10:58 root[[email protected] cron]# Pwd/var/spool/cron[[email protected] cron]# Cat Root 30 03 * * */root/automysqlbackup.sh

Method 2:

Edit the timed script using the command vi/etc/crontab.

Such as:

[[email protected] ~]# Cat/etc/crontab                                                                                                                                             Shell=/bin/bash                                                                                                                                                                    Path=/sbin:/bin:/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/e                                                                                                                                    Tc/cron.hourly                            4 * * * Root run-parts/etc/cron.daily 4 * * 0 Roo                                                                                                                                                                T run-parts/etc/cron.weekly                                                                                                                                       4 1 * * Root run-parts/etc/cron.monthly                                                                                                                                          */1 * * * * Root run-parts/opt/openoffice.org3/program/start.sh ##################                                                                                                                        ##########################                                                                                                                          30 4  * * * ROOT/USR/BIN/RSYNC-VZRTOPG--progress--delete [Email protected]::resource/hyy/bak/resource 4 * * * * root /USR/BIN/RSYNC-VZRTOPG--progress--delete [email protected]::log/hyy/bak/log###############################  #############[[email protected] ~]#


System-level configuration we will directly configure the/etc/crontab

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




Linux configuration timing, the difference between using CRONTAB-E and direct edit/etc/crontab

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.