. Dir= $/* des= $ # Test The destination dirctory whether exists[- D $des] Echo "Dir Exist"Exit 1 # Create The destination dirctoryMkdir$des # Set counter, it would auto increase to the number of# source file. I=0 # Count of the number of source fileN= 'Echo $/* |wc-w ' forFileinch`Echo $dir` Do # Calculate Progresspercent=$ (( -* (++i)/n)) Cat $percentCopying file$file... XXX Eof/bin/cp-r$file $des>/dev/null Done| Dialog--title"Copy"--gauge"Files" 6 -ClearEffect9.Echo outputFea
example: "0/15" in sub-expressions (minutes) means starting from the No. 0 minute, every 15 minutes"3/20" in the sub-expression (minutes) means that every 20 minutes (it is the same as "3,23,43") starting from the 3rd minute“? "Character is used only for days (months) and days (weeks) of two sub-expressions, indicating that no value is specifiedWhen one of the 2 sub-expressions is assigned a value, in order to avoid a conflict, you need to set the value of another subexpression to "? ”The "L" c
written crontab is then executed every minute, as follows:
Copy Code code as follows:
Crontab-e
* * * * */bin/bash/home/somedir/cron-seconds.sh * * *
The third method:
So how do you use a scheduled task to implement it directly?The final solution is as follows, and it is validated that the script runs very stably.
Copy Code code as follows:
Crontab-e
# # for Excuting scripts.sh every 3 seconds# #on 2014-10-15
This example describes the PHP version of the Cron Timer task executor usage, which is a very useful functional application. The specific methods are as follows:
Since the server crontab can only be accurate to minutes, the starting point of the program is also minutes.
This feature consists of three parts altogether:
First, the configuration file:
The configuration file is used to return the scheduled task file to be executed, note the use of the
The previous two is a simple trigger (Simpletrigger), Simpletrigger can only handle simple events, if you want to be flexible to trigger the task, you need to
Crontrigger this important person.
Crontrigger is also one of the most important features of quartz, by quartz specific cron expression to determine a certain kind of time, can complete similar "November 11, 2011 (God Stick Day, has passed), each Wednesday xxx" complex timing tasks.
Code or old
Tags: 10.23 Linux Task Scheduler cron10.23 Linux Task Scheduler cronCommand parameters for Crontab-u specifies a user, without-u, refers to the current user-e indicates a task plan, similar to the use of vim-l lists the current task schedule-R Delete Task schedule10.24 Chkconfig Tools10.25 SYSTEMD Management Services10.26 Unit Introduction10.27 Target IntroductionRelationships between service, unit, and target1. A service is part of a unit2. Multiple unit together to form a target3. A target con
UnitService System ServicesTarget multiple units consisting of groupsDevice hardware devicesMount File System mount pointAutoMount Automatic mount pointPath file or pathSCOP is not an external process initiated by SYSTEMDSlice Process GroupSnapshot Systemd SnapshotSocket inter-process communication socketsSwap fileTimer TimerUnit-related instructionsSystemctl List-units lists the running unitSystemctl list-units--all list all, including failed or inactiveSystemctl list-units--all--state=inactiv
Archiving and compression of Linux:1. Space saving2. Facilitate the management of fragmented documentsTar Integrated Backup tool:-C: Create an archive-X: Release Archive-F: Specify the Archive file name-Z,-j,-j: Call the GZ, bz2, XZ format tools for processing-C: Specify the release location-P: Maintain absolute path to files within archive-TAR-ZCF backup files. tar.gz files that are backed up-TAR-JCF backup files. tar.bz2 files that are backed up-TAR-JCF backup files. tar.xz files that are back
The cron expression of quartz is in the order of seconds (0 ~ 59) minutes (0 ~ 59) hour (0 ~ 23) days (months) (0 ~ 31, but you need to consider the number of days of your month) month (0 ~ 11) Day (week) (1 ~ 7 1 = sun, Mon, Tue, wed, Thu, Fri, SAT) 7. year (1970-2099), where each element can be a value (for example, 6), a continuous interval (9-12), and an interval (8-18/4) (/indicates every 4 hours), a list (1, 3, 5), wildcard. Because the two elem
For more information about shell programming and cron planning tasks-Linux general technology-Linux programming and kernel, see the following. Recently, a server encountered a problem (the specific cause has not been identified. The initial diagnosis is that the php load is too high, leading to network congestion, and eventually the network crashes and cannot access the Internet. This is an out-of-the-box question. it has nothing to do with this topic
backup policy
There are many ways to trigger a synchronization instruction, for example, you can put the synchronization instructions in the client system's crontab Daemon, set the sync time, and then let Linux the system triggers the synchronization instruction and completes the data backup automatically. This method of data backup can be used in business systems where data security requirements are not high. For example: set every morning 3 Point - perform a mirrored backup ofThis article i
First, homework (exercise) content:1. Summarize the detailed usage method of the task plan (at, crontab) on Linux system;answer:http://blog.51cto.com/user_index.php?action=addblog_newdid=1648072, every Monday to Saturday 3:20 A.M., run the CP command to archive the/etc/directory, storage location is/BACKUPS/ETC-YYYY-MM-DD;Answer: 3 * * 1-6/bin/cp-rf/etc/*/backup/etc-' date + $F '3, every Sunday 2:30 A.M., run the CP command to backup the/etc/fstab file, the storage location is/BACKUP/FSTAB-YYYY-
First, homework (exercise) content:1. Summarize the detailed usage method of the task plan (at, crontab) on Linux system;http://xiexiaojun.blog.51cto.com/2305291/16880682, every Monday to Saturday 3:20 A.M., run the CP command to archive the/etc/directory, storage location is/BACKUPS/ETC-YYYY-MM-DD;2 * * * 1-6/bin/cp-a/etc//backups/etc-$ (date +%f) >/dev/null3, every Sunday 2:30 A.M., run the CP command to backup the/etc/fstab file, the storage location is/BACKUP/FSTAB-YYYY-MM-DD-HH-MM-SS;2 * *
root@~:~# CRONTAB-E
No crontab for root-using an empty one
888
I can't do it from the new installation.
There's no way to get into edit cron
Reply to discussion (solution)
Ubuntu System Admin on the first-line server set up a scheduled task, accidentally selected Nano, because the previous contact is Redhat series, not accustomed to use Nano, so want to reset, online check under, seemingly no.Helpless under, re-install a server test, found t
Some functions such as timing function and certain methods can be implemented by timing task scheduling framework quartz. The following provides a simple example of implementing the quartz framework of Hello World.Importorg.quartz.CronExpression;ImportOrg.quartz.CronTrigger;ImportOrg.quartz.Job;ImportOrg.quartz.JobDetail;ImportOrg.quartz.JobExecutionContext;Importorg.quartz.JobExecutionException;ImportOrg.quartz.Scheduler;Importorg.quartz.SchedulerException;Importorg.quartz.SchedulerFactory;Impo
PackageCom.pkfare.task.manage.config;ImportOrg.quartz.spi.TriggerFiredBundle;Importorg.springframework.beans.BeansException;ImportOrg.springframework.context.ApplicationContext;ImportOrg.springframework.context.ApplicationContextAware;Importorg.springframework.context.annotation.Configuration;Importorg.springframework.scheduling.quartz.SpringBeanJobFactory;Importorg.springframework.stereotype.Component, @Configuration @component Public classJobbeanjobfactoryextendsSpringbeanjobfactoryImplementsA
The command to view a timed task is: crontab-l the command to edit a timed task is: CRONTAB-E (effective immediately after editing if comments can be added at the beginning of the line with # and VI) Timed task description each action a taskEach line is divided into six sections, each separated by a space and separated by commas.Minute hour day_of_month month weekday commandUsing * in the first five fields means all points in timeminute:0-59Hour:0-23,0 stands for 0 pointsDay_of_month:1-31Month:1
Cron expressions (used in quartz.net)Consists of 7 segments: The second day of the Month and the Moon (optional)"-": The range mon-wed represents Monday to Wednesday",": The enumeration Mon,web represents Monday and Wednesday"*": Table is "per", monthly, daily, weekly, yearly etc.For the week inside, Sun=1 sat=6"/": Represents the Increment: 0/15 (in minutes) every 15 minutes, starting after 0 minutes, 3/20 every 20 minutes, starting from 3 minutes la
from 0 to 59.Hour: Represents the hour, which can be any integer from 0 to 23.Day: Represents a date, which can be any integer from 1 to 31.Month: Represents the month, which can be any integer from 1 to 12.Week: Represents the day of the week, which can be any integer from 0 to 7, where 0 or 7 represents Sunday.Command: The commands to execute can be either system commands or script files that you write yourself.10.24 Chkconfig Tools10.25 SYSTEMD Management ServicesCrond service startup will b
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.