日期:2014-05-16  浏览次数:20906 次

从来都没用过UNIX,请问CRON是什么,怎么用啊.
从来都没用过UNIX,CORN的作用和语法跟本就不知道,客户发给我一个EMAIL,原文如下:
> DB设置
>   [root]
>   0       *   *   *   *     /home/homepage/batch/updateclick.php
>   30     3   *   *   *     /home/homepage/batch/cleanup_click_dups.pl
>   50     3   *   *   *     /home/homepage/batch/aggr_click.php
>   0       *   *   *   *     /home/homepage/batch/checklink.pl
>   */15   *   *   *   *     /home/homepage/batch/checkbudget.pl
>   30   4   *   *   *     /home/homepage/batch/checkclickbudget.pl
>   */10   *   *   *   *   /home/homepage/batch/pointback.pl   > >
/var/log/cross-a/pointback.log   2> &1
>   30   9   *   *   *   /home/homepage/batch/approval_reminder.pl
>   5,15,25,35,45,55   *   *   *   *   find   /var/log/cross-a   -name
"pointback.log "   -and   -cmin   -20   |   xargs   tail   -1   |   grep   "can 't   lock   lockfile "
>
>   0   4   *   *   *   /usr/bin/vacuumdb   -U   postgres   -a   -z   -q
>   30   *   *   *   *   /usr/bin/psql   -U   crossa   -f   /home/homepage/sql/vacuum_hourly.sql
crossa   >   /dev/null
>   5   2,12,22   *   *   *   /usr/bin/psql   -U   crossa   -f
/home/homepage/sql/cleanup_auth.sql   crossa   >   /dev/null
>
>   [homepage]
>   0   4   *   *   *   rsync   -a   --delete   batch   sql   cmd.backup
>   0   4   *   *   *   rsync   -a   --delete   -e   ssh   batch/   www2:backup/batch.db1
>   0   4   *   *   *   rsync   -a   --delete   -e   ssh   sql/   www2:backup/sql.db1
>
>   [postgres]
>   0   3   *   *   *   /home/homepage/batch/backup.db.sh
>   0   4   *   *   *   /home/homepage/batch/backup.dbbase.sh
>   */5   *   *   *   *   rsync   -a   --delete   /var/lib/pgsql/wal/
www2:/var/lib/pgsql/backup.db1/wal
>   0   3   *   *   *   find   /var/lib/pgsql/wal/   -ctime   +7   |   xargs   rm   -f
>   0   3   *   *   *   find   /var/lib/pgsql/data/pg_log/   -ctime   +7   |   xargs   rm   -f
>
>
>   web设置
>
>   [homepage]
>   0   4   *   *   *   rsync   -a   --delete   /home/homepage/htdocs/
/home/homepage/htdocs.backup
>   0   4   *   *   *   rsync   -a   --delete   -e   ssh   /home/homepage/htdocs/
www2:backup/htdocs.www1
请问这个东西直接拷贝到CRONTAB文件中就可以了吗,前面的> 是什么啊,请高手帮我整理一下这些语句,例如> 是不是需要,哪些东西是一行的,编辑完了怎么运行啊.谢谢.

------解决方案--------------------
前面的> 是要去掉的.去掉以后应该就可以用了.

前5位是按照cron的分/时/日/月/周的顺序配置的运行时间设置

------解决方案----------------