Home PC Games Linux Windows Database Network Programming Server Mobile  
  Home \ Linux \ Under CentOS using yum command to install the Task Scheduler crontab     - Differences Shell scripting languages and compiled languages (Programming)

- How to upgrade to Oracle 11g Oracle 12c (Database)

- How nodeclub constructed Docker image (Server)

- Python programming style (Programming)

- Shell script to delete empty folders recursively (Linux)

- Inherent limitations of Linux systems network security (Linux)

- Error code: 2013 Lost connection to MySQL server during query (Database)

- Use eCryptFS encrypt files and directories on Linux (Linux)

- Nmcli based network management command-line tool (Linux)

- Chkconfig set boot start under Linux (Linux)

- Linux basis: a comprehensive study pwd command (Linux)

- systemd run levels and service management command Introduction (Linux)

- Eclipse Android development environment installation (Linux)

- Ceph distributed storage system is installed on a CentOS 7.1 (Server)

- Advanced Search Oracle study notes (Database)

- Ubuntu modify DNS restart loss problem (Linux)

- DRBD switchover (Server)

- Linux process or thread is bound to a CPU (Programming)

- Quagga use authentication on strengthening BGP session security (Linux)

- Using Python multithreaded mistakes summary (Programming)

  Under CentOS using yum command to install the Task Scheduler crontab
  Add Date : 2018-11-21      
Using the "Task Scheduler" can be any script, program or document to run at a scheduled time most convenient. Popular talk is the time to execute a script program.

Common uses
Off Timer
Regularly check for updates
Timing system configuration, database, backup log
Regularly clean up junk files

Detecting whether installed
# Crontab
-bash: crontab: command not found

Execute crontab command if the message command not found, it indicates not installed.

start installation
# Yum -y install vixie-cron
Loaded plugins: fastestmirror, refresh-packagekit, security
Existing lock /var/run/yum.pid: another copy is running as pid 25960.
Another app is currently holding the yum lock; waiting for it to exit ...

The system automatically upgrades may be running, yum in the locked state.
You can turn off mandatory yum process:
#rm -f /var/run/yum.pid
Then you can use the yum.

# Yum -y install vixie-cron
Loaded plugins: fastestmirror, refresh-packagekit, security
Determining fastest mirrors
 * Base: mirrors.btte.net
 * Extras: mirrors.sina.cn
 * Updates: mirrors.sina.cn
base | 3.7 kB 00:00
extras | 3.4 kB 00:00
extras / primary_db | 32 kB 00:00
updates | 3.4 kB 00:00
updates / primary_db | 1.9 MB 00:07
Setting up Install Process
Resolving Dependencies
-> Running transaction check
---> Package cronie.x86_64 0: 1.4.4-15.el6 will be installed
-> Processing Dependency: dailyjobs for package: cronie-1.4.4-15.el6.x86_64
-> Processing Dependency: / usr / sbin / sendmail for package: cronie-1.4.4-15.el6.x86_64
-> Running transaction check
---> Package cronie-anacron.x86_64 0: 1.4.4-15.el6 will be installed
-> Processing Dependency: crontabs for package: cronie-anacron-1.4.4-15.el6.x86_64
---> Package sendmail.x86_64 0: 8.14.4-9.el6 will be installed
-> Processing Dependency: procmail for package: sendmail-8.14.4-9.el6.x86_64
-> Running transaction check
---> Package crontabs.noarch 0: 1.10-33.el6 will be installed
---> Package procmail.x86_64 0: 3.22-25.1.el6_5.1 will be installed
-> Finished Dependency Resolution

Dependencies Resolved

================================================== ======================
 Package Arch Version Repository Size
================================================== ======================
 cronie x86_64 1.4.4-15.el6 base 74 k
Installing for dependencies:
 cronie-anacron x86_64 1.4.4-15.el6 base 31 k
 crontabs noarch 1.10-33.el6 base 10 k
 procmail x86_64 3.22-25.1.el6_5.1 base 162 k
 sendmail x86_64 8.14.4-9.el6 base 716 k

Transaction Summary
================================================== ======================
Install 5 Package (s)

Total download size: 994 k
Installed size: 2.1 M
Downloading Packages:
(1/5): cronie-1.4.4-15.el6.x86_64.rpm | 74 kB 00:00
(2/5): cronie-anacron-1.4.4-15.el6.x86_64.rpm | 31 kB 00:00
(3/5): crontabs-1.10-33.el6.noarch.rpm | 10 kB 00:00
(4/5): procmail-3.22-25.1.el6_5.1.x86_64.rpm | 162 kB 00:00
(5/5): sendmail-8.14.4-9.el6.x86_64.rpm | 716 kB 00:00

-------------------------------------------------- -------------------------------------------------- ----------------------------
Total 1.3 MB / s | 994 kB 00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing: procmail-3.22-25.1.el6_5.1.x86_64 1/5
  Installing: sendmail-8.14.4-9.el6.x86_64 2/5
  Installing: cronie-1.4.4-15.el6.x86_64 3/5
  Installing: crontabs-1.10-33.el6.noarch 4/5
  Installing: cronie-anacron-1.4.4-15.el6.x86_64 5/5
ERROR: dbus.proxies: Introspect error on: 1.2513: / org / freedesktop / PackageKit: dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NoReply: Did not receive a reply Possible causes include:. The remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
Unable to send message to PackageKit
  Verifying: crontabs-1.10-33.el6.noarch 1/5
  Verifying: cronie-anacron-1.4.4-15.el6.x86_64 2/5
  Verifying: sendmail-8.14.4-9.el6.x86_64 3/5
  Verifying: cronie-1.4.4-15.el6.x86_64 4/5
  Verifying: procmail-3.22-25.1.el6_5.1.x86_64 5/5

  cronie.x86_64 0: 1.4.4-15.el6

Dependency Installed:
  cronie-anacron.x86_64 0: 1.4.4-15.el6 crontabs.noarch 0: 1.10-33.el6 procmail.x86_64 0: 3.22-25.1.el6_5.1 sendmail.x86_64 0: 8.14.4-9.el6


View command help
crontab does not support the option -help -h or the like, but it can still view the command help

# Crontab -h
crontab: invalid option - h
crontab: usage error: unrecognized option
usage: crontab [-u user] file
    crontab [-u user] [-e | -l | -r]
        (Default operation is replace, per 1003.2)
    -e (edit user's crontab)
    -l (list user's crontab)
    -r (delete user's crontab)
    -i (prompt before deleting user's crontab)
    -s (selinux context) 1
You can also use info crontab command to view detailed help information.

cron service providers to set the cron crontab command service, the following are some of the parameters and description of this command:

crontab -u // set a user's cron service, usually root user needs this parameter when executing this command

crontab -l // list the details of a user cron services

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

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

For example, set the root view their own cron: crontab -u root -l

For another example, root you want to delete the cron setting fred: crontab -u fred -r

In the editing cron service, edit the contents of some of the formats and conventions, enter: crontab -u root -e

Enter vi edit mode, edit the content must meet the following format: / 1 * * * ls >> /tmp/ls.txt

Service state control
/ Sbin / service crond start // Start Service
/ Sbin / service crond stop // Close Service
/ Sbin / service crond restart // restart the service
/ Sbin / service crond reload // reload the configuration
/ Sbin / service crond status // View Status

Or use

# Service crond start
# Service crond stop
# Service crond restart
# Service crond reload
# Service crond status

You can use this service to start automatically when the system starts:
At the end of /etc/rc.d/rc.local script plus:

/ Sbin / service crond start
Cron is now inside the service has been in the process, we can use this service up.
- CentOS 6.5 can not connect to the network under VMware (Linux)
- Compile and install Ubuntu Linux 4.0.5 kernel, network and fix vmware kernel module compilation error (Linux)
- MySQL stored procedures and triggers (Database)
- Nine artifact control disk partition under Linux (Linux)
- Ubuntu Slingscold (Linux)
- C ++ containers (Programming)
- Use scripts easily install the latest Linux kernel in Ubuntu (Linux)
- How to install Wine 1.7.20 under Ubuntu or Linux Mint (Linux)
- Compile Android libwebcore.so error occurs when solving (Programming)
- The REVERSE function of DB2 (Database)
- How to install the client sqlplus under linux (Database)
- When RHEL7 use fdisk partition, all partitions can not be used (Linux)
- CentOS NAT iptables (Linux)
- Java rewrite the hashcode method (Programming)
- Configuring xdebug debugging environment in Ubuntu 14.04 under the PhpStorm (Linux)
- Linux System Getting Started Learning: Debian download, installation and graphical interface (Linux)
- Github inventory objects Algorithm (Linux)
- Linux 0.12 kernel and modern kernels difference in memory management (Linux)
- Ubuntu 14.04 compile, install, configure, the latest development version GoldenDict (Linux)
- Ubuntu install perfectly handsome terminal Guake 0.8.1 (Linux)
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.