S
S
Sergey2019-02-27 16:36:01
linux
Sergey, 2019-02-27 16:36:01

Why are not all commands added to cron?

Hello. I wrote a small script and it contains an item with adding commands to cron:

(crontab -l ; echo "*/2 * * * * screen -dmS scan_servers bash -c 'cd /var/www && php cron.php 1234 threads scan_servers'
*/2 * * * * screen -dmS scan_servers bash -c 'cd /var/www && php cron.php 1234 threads scan_servers'
*/5 * * * * screen -dmS scan_servers_load bash -c 'cd /var/www && php cron.php 1234 threads scan_servers_load'
*/5 * * * * screen -dmS scan_servers_route bash -c 'cd /var/www && php cron.php 1234 threads scan_servers_route'
*/1 * * * * screen -dmS scan_servers_down bash -c 'cd /var/www && php cron.php 1234 threads scan_servers_down'
*/10 * * * * screen -dmS notice_help bash -c 'cd /var/www && php cron.php 1234 notice_help'
*/15 * * * * screen -dmS scan_servers_stop bash -c 'cd /var/www && php cron.php 1234 threads scan_servers_stop'
*/15 * * * * screen -dmS scan_servers_copy bash -c 'cd /var/www && php cron.php 1234 threads scan_servers_copy'
*/30 * * * * screen -dmS notice_server_overdue bash -c 'cd /var/www && php cron.php 1234 notice_server_overdue'
*/30 * * * * screen -dmS preparing_web_delete bash -c 'cd /var/www && php cron.php 1234 preparing_web_delete'
*/60 * * * * screen -dmS scan_servers_admins bash -c 'cd /var/www && php cron.php 1234 threads scan_servers_admins'
*/1 * * * * screen -dmS control_delete bash -c 'cd /var/www && php cron.php 1234 control_delete'
*/1 * * * * screen -dmS control_install bash -c 'cd /var/www && php cron.php 1234 control_install'
*/2 * * * * screen -dmS scan_control bash -c 'cd /var/www && php cron.php 1234 scan_control'
*/2 * * * * screen -dmS control_scan_servers bash -c 'cd /var/www && php cron.php 1234 control_threads control_scan_servers'
*/5 * * * * screen -dmS control_scan_servers_route bash -c 'cd /var/www && php cron.php 1234 control_threads control_scan_servers_route'
*/1 * * * * screen -dmS control_scan_servers_down bash -c 'cd /var/www && php cron.php 1234 control_threads control_scan_servers_down'
*/60 * * * * screen -dmS control_scan_servers_admins bash -c 'cd /var/www && php cron.php 1234 control_threads control_scan_servers_admins'
*/15 * * * * screen -dmS control_scan_servers_copy bash -c 'cd /var/www && php cron.php 1234 control_threads control_scan_servers_copy'
*/5 * * * * screen -dmS graph_servers_day bash -c 'cd /var/www && php cron.php 1234 threads graph_servers_day' 
*/5 * * * * screen -dmS graph_servers_hour bash -c 'cd /var/www && php cron.php 1234 threads graph_servers_hour'") 2>&1 | grep -v "no crontab" | sort | uniq | crontab -
  chown root:crontab /var/spool/cron/crontabs/root

And in the crown, there is only a part:
*/10 * * * * screen -dmS notice_help bash -c 'cd /var/www && php cron.php 1234 notice_help'
*/15 * * * * screen -dmS control_scan_servers_copy bash -c 'cd /var/www && php cron.php 1234 control_threads control_scan_servers_copy'
*/15 * * * * screen -dmS scan_servers_copy bash -c 'cd /var/www && php cron.php 1234 threads scan_servers_copy'
*/15 * * * * screen -dmS scan_servers_stop bash -c 'cd /var/www && php cron.php 1234 threads scan_servers_stop'
*/1 * * * * screen -dmS control_delete bash -c 'cd /var/www && php cron.php 1234 control_delete'
*/1 * * * * screen -dmS control_install bash -c 'cd /var/www && php cron.php 1234 control_install'
*/1 * * * * screen -dmS control_scan_servers_down bash -c 'cd /var/www && php cron.php 1234 control_threads control_scan_servers_down'
*/1 * * * * screen -dmS scan_servers_down bash -c 'cd /var/www && php cron.php 1234 threads scan_servers_down'
*/2 * * * * screen -dmS control_scan_servers bash -c 'cd /var/www && php cron.php 1234 control_threads control_scan_servers'
*/2 * * * * screen -dmS scan_control bash -c 'cd /var/www && php cron.php 1234 scan_control'
*/2 * * * * screen -dmS scan_servers bash -c 'cd /var/www && php cron.php 1234 threads scan_servers'
*/30 * * * * screen -dmS notice_server_overdue bash -c 'cd /var/www && php cron.php 1234 notice_server_overdue'
*/30 * * * * screen -dmS preparing_web_delete bash -c 'cd /var/www && php cron.php 1234 preparing_web_delete'
*/5 * * * * screen -dmS control_scan_servers_route bash -c 'cd /var/www && php cron.php 1234 control_threads control_scan_servers_route'
*/5 * * * * screen -dmS graph_servers_day bash -c 'cd /var/www && php cron.php 1234 threads graph_servers_day'
*/5 * * * * screen -dmS graph_servers_hour bash -c 'cd /var/www && php cron.php 1234 threads graph_servers_hour'
*/5 * * * * screen -dmS scan_servers_load bash -c 'cd /var/www && php cron.php 1234 threads scan_servers_load'
*/5 * * * * screen -dmS scan_servers_route bash -c 'cd /var/www && php cron.php 1234 threads scan_servers_route'
*/60 * * * * screen -dmS control_scan_servers_admins bash -c 'cd /var/www && php cron.php 1234 control_threads control_scan_servers_admins'
*/60 * * * * screen -dmS scan_servers_admins bash -c 'cd /var/www && php cron.php 1234 threads scan_servers_admins'

I also noticed that they were added in a different order.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry, 2019-02-27
@t3g1ng

The order is formed from problem books of different types of time intervals
Like all files

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question