<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Linux Forum &mdash; CentOS crond не работает]]></title>
	<link rel="self" href="https://linuxforum.ru/extern.php?action=feed&amp;tid=13171&amp;type=atom" />
	<updated>2011-04-29T11:04:08Z</updated>
	<generator>PunBB</generator>
	<id>https://linuxforum.ru/viewtopic.php?id=13171</id>
		<entry>
			<title type="html"><![CDATA[Re: CentOS crond не работает]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=173749#p173749" />
			<content type="html"><![CDATA[<p>вот подробный мануал на вашу систему: <strong>info coreutils &#039;date invocation&#039;</strong></p>]]></content>
			<author>
				<name><![CDATA[drBatty]]></name>
				<uri>https://linuxforum.ru/profile.php?id=86</uri>
			</author>
			<updated>2011-04-29T11:04:08Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=173749#p173749</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: CentOS crond не работает]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=173738#p173738" />
			<content type="html"><![CDATA[<p>Ок. <br />Буду знать.<br />Спасибо!</p>]]></content>
			<author>
				<name><![CDATA[Munsera]]></name>
				<uri>https://linuxforum.ru/profile.php?id=10733</uri>
			</author>
			<updated>2011-04-29T10:35:01Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=173738#p173738</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: CentOS crond не работает]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=173736#p173736" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Munsera пишет:</cite><blockquote><p>Посмотрел Лог и понял что крон как-то неправильно его обрабатывает. Заменил</p><p>/home/Cisco_Backup/cisco.exp `date +%Y-%m-%d_%H-%M-%S.%N`</p><p>на</p><p>/home/Cisco_Backup/cisco.exp `date +%Y-%m-%d</p><p>И все заработало!!!</p></blockquote></div><p>потому-что в целях безопасности crond использует стандартную date. А в POSIX нет %H - это гнутое расширение. Забыл я вам об этом сказать сразу...</p><p>ЗЫЖ поправочка:<br /></p><div class="codebox"><pre><code>`date&#039; conversion specifiers related to times.

`%H&#039;
     hour (`00&#039;...`23&#039;)

`%I&#039;
     hour (`01&#039;...`12&#039;)

`%k&#039;
     hour (` 0&#039;...`23&#039;).  This is a GNU extension.

`%l&#039;
     hour (` 1&#039;...`12&#039;).  This is a GNU extension.

`%M&#039;
     minute (`00&#039;...`59&#039;)

`%N&#039;
     nanoseconds (`000000000&#039;...`999999999&#039;).  This is a GNU extension.

`%p&#039;
     locale&#039;s equivalent of either `AM&#039; or `PM&#039;; blank in many locales.
     Noon is treated as `PM&#039; and midnight as `AM&#039;.

`%P&#039;
     like `%p&#039;, except lower case.  This is a GNU extension.

`%r&#039;
     locale&#039;s 12-hour clock time (e.g., `11:11:04 PM&#039;)

`%R&#039;
     24-hour hour and minute.  Same as `%H:%M&#039;.  This is a GNU
     extension.

`%s&#039;
     seconds since the epoch, i.e., since 1970-01-01 00:00:00 UTC.
     Leap seconds are not counted unless leap second support is
     available.  *Note %s-examples::, for examples.  This is a GNU
     extension.</code></pre></div><p>наносекунд нет в стандарте.</p>]]></content>
			<author>
				<name><![CDATA[drBatty]]></name>
				<uri>https://linuxforum.ru/profile.php?id=86</uri>
			</author>
			<updated>2011-04-29T10:26:48Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=173736#p173736</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: CentOS crond не работает]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=173733#p173733" />
			<content type="html"><![CDATA[<p>Ребята, большое спасибо за ответы и помостчь!!!</p><p>Посмотрел Лог и понял что крон как-то неправильно его обрабатывает. Заменил </p><p>/home/Cisco_Backup/cisco.exp `date +%Y-%m-%d_%H-%M-%S.%N`</p><p>на</p><p>/home/Cisco_Backup/cisco.exp `date +%Y-%m-%d </p><p>И все заработало!!! <br />Большое спасибо!!!</p>]]></content>
			<author>
				<name><![CDATA[Munsera]]></name>
				<uri>https://linuxforum.ru/profile.php?id=10733</uri>
			</author>
			<updated>2011-04-29T10:16:12Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=173733#p173733</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: CentOS crond не работает]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=173404#p173404" />
			<content type="html"><![CDATA[<p><strong>Munsera</strong>, учтите, этот скрипт выполняется <strong>только в первую минуту каждого часа</strong>. ждали?</p>]]></content>
			<author>
				<name><![CDATA[drBatty]]></name>
				<uri>https://linuxforum.ru/profile.php?id=86</uri>
			</author>
			<updated>2011-04-28T16:29:14Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=173404#p173404</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: CentOS crond не работает]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=173391#p173391" />
			<content type="html"><![CDATA[<p>В конце <br /></p><div class="codebox"><pre><code>1 * * * * /home/Cisco_Backup/script.exp 2&gt;&amp;1 &gt;&gt;/var/log/siska_backup.log</code></pre></div><p>есть перенос строки? <br />Может поможет добавление пустой строки в конце?</p>]]></content>
			<author>
				<name><![CDATA[anonymousRU]]></name>
				<uri>https://linuxforum.ru/profile.php?id=12113</uri>
			</author>
			<updated>2011-04-28T15:46:34Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=173391#p173391</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: CentOS crond не работает]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=173385#p173385" />
			<content type="html"><![CDATA[<p><strong>Hrafn</strong>, Если напрямую запустить, то скрипт тоже отрабатывается. Только переменная не присваивается и все) Пишется как есть)</p><p><strong>drBatty</strong>, Прописал, но только почему-то файл siska_backup.log не создался((</p>]]></content>
			<author>
				<name><![CDATA[Munsera]]></name>
				<uri>https://linuxforum.ru/profile.php?id=10733</uri>
			</author>
			<updated>2011-04-28T15:36:56Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=173385#p173385</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: CentOS crond не работает]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=173376#p173376" />
			<content type="html"><![CDATA[<p>Доктор, спасибо, что пришел <img src="https://linuxforum.ru/img/smilies/ab.gif" alt="ab" /> он тебя больше проку будет<br />да и не дистроспецифично это все</p>]]></content>
			<author>
				<name><![CDATA[Hrafn]]></name>
			</author>
			<updated>2011-04-28T15:13:56Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=173376#p173376</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: CentOS crond не работает]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=173375#p173375" />
			<content type="html"><![CDATA[<p><strong>Munsera</strong>, а если в конце строчки в crontab -e написать<br /></p><div class="codebox"><pre><code>1 * * * * /home/Cisco_Backup/script.exp 2&gt;&amp;1 &gt;&gt;/var/log/siska_backup.log</code></pre></div><p>?</p>]]></content>
			<author>
				<name><![CDATA[drBatty]]></name>
				<uri>https://linuxforum.ru/profile.php?id=86</uri>
			</author>
			<updated>2011-04-28T15:12:34Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=173375#p173375</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: CentOS crond не работает]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=173374#p173374" />
			<content type="html"><![CDATA[<p>я если запустить напрямую скрипт cisco.exp, а не script.exp?</p>]]></content>
			<author>
				<name><![CDATA[Hrafn]]></name>
			</author>
			<updated>2011-04-28T15:04:52Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=173374#p173374</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: CentOS crond не работает]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=173357#p173357" />
			<content type="html"><![CDATA[<p>А Сам скрипт который я запускаю и который в кроне вот:<br />/home/Cisco_Backup/script.exp <br /></p><div class="codebox"><pre><code>#!/bin/bash -x
/home/Cisco_Backup/cisco.exp `date +%Y-%m-%d_%H-%M-%S.%N`</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Munsera]]></name>
				<uri>https://linuxforum.ru/profile.php?id=10733</uri>
			</author>
			<updated>2011-04-28T14:12:11Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=173357#p173357</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: CentOS crond не работает]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=173356#p173356" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>#!/usr/bin/expect -f

set force_conservative 0  ;# set to 1 to force conservative mode even if
                          ;# script wasn&#039;t run conservatively originally


set dates [lindex $argv 0]

if {$force_conservative} {
        set send_slow {1 .1}
        proc send {ignore arg} {
                sleep .1
                exp_send -s -- $arg
        }
}



set timeout -1
spawn ssh логин@ипка
match_max 100000
expect -exact &quot;\r\r
-----------------------------------------------------------------------\r
Cisco Router and Security Device Manager (SDM) is installed on this device. \r
This feature requires the one-time use of the username \&quot;cisco\&quot; \r
with the password \&quot;cisco\&quot;. The default username and password have a privilege level of 15.\r
\r
Please change these publicly known initial credentials using SDM or the IOS CLI. \r
Here are the Cisco IOS commands.\r
\r
username &lt;myuser&gt;  privilege 15 secret 0 &lt;mypassword&gt;\r
no username cisco\r
\r
Replace &lt;myuser&gt; and &lt;mypassword&gt; with the username and password you want to use. \r
\r
For more information about SDM please follow the instructions in the QUICK START \r
GUIDE for your router or go to http://www.cisco.com/go/sdm \r
-----------------------------------------------------------------------\r
Password: &quot;
send -- &quot;пароль\r&quot;
expect -exact &quot;\r
\r
nizh#&quot;
send -- &quot;copy run tftp://ипка/$dates&quot;
expect -exact &quot;copy run tftp://ипка/$dates&quot;
send -- &quot;\r&quot;
expect -exact &quot;\r
Address or name of remote host \[ип\]? &quot;
send -- &quot;\r&quot;
expect -exact &quot;\r
Destination filename \[$dates\]? &quot;
send -- &quot;\r&quot;
expect -exact &quot;\r
!!\r
18273 bytes copied in 0.628 secs (29097 bytes/sec)\r
nizh#&quot;
send -- &quot;exit\r&quot;
expect eof</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Munsera]]></name>
				<uri>https://linuxforum.ru/profile.php?id=10733</uri>
			</author>
			<updated>2011-04-28T14:07:29Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=173356#p173356</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: CentOS crond не работает]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=173350#p173350" />
			<content type="html"><![CDATA[<p>покажите хоть скрипт</p>]]></content>
			<author>
				<name><![CDATA[Hrafn]]></name>
			</author>
			<updated>2011-04-28T13:54:13Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=173350#p173350</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: CentOS crond не работает]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=173348#p173348" />
			<content type="html"><![CDATA[<p>Просто если я его запускаю из консоли, он отрабатывается все норм!<br />Вот и сижу гадаю.. почему из крона не родит...</p>]]></content>
			<author>
				<name><![CDATA[Munsera]]></name>
				<uri>https://linuxforum.ru/profile.php?id=10733</uri>
			</author>
			<updated>2011-04-28T13:49:19Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=173348#p173348</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: CentOS crond не работает]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=173340#p173340" />
			<content type="html"><![CDATA[<p>кстати, я не вижу признаков того, что скрипт не запускается<br />быть может, он запускается, но не отрабатывает? тогда другой разговор</p>]]></content>
			<author>
				<name><![CDATA[Hrafn]]></name>
			</author>
			<updated>2011-04-28T13:41:12Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=173340#p173340</id>
		</entry>
</feed>
