From: "Овечкин Влад" <test@rrnn.ru>
To: community@altlinux.ru
Subject: [Comm] Скрипт для проверки успешной записи ftp
Date: Thu, 26 May 2005 14:02:32 +0400
Message-ID: <42959EB8.6030103@rrnn.ru> (raw)
Добрый день!
Подскажите, как реализовать проверку (лучше с примером) успешной записи
на ftp-сервер файла.
Дело в том, что мне необходимо раз в день скидывать логи с одной машины
на другую.
Для этого есть скрипт:
#!/bin/bash
VAR1=log-`date -d yesterday +%d-%m-%Y`.tar.bz2;
echo "user anonymous password" > script5;
echo "lcd /var/log/stat-logs" >> script5;
echo "cd incoming" >> script5;
echo "put $VAR1" >> script5;
echo "bye" >> script5;
ftp -n 192.168.1.5 < ./script5;
# Записывается без проблем. А дальше - затык. То есть если успешно
записалось в архив - то файлик с машинки можно удалить. Если же нет - то
повторить копирование (да ещё и с предварительным стиранием
недозаписанного файла) и опять проверить всё ли нормально записалось.
if [ $? -eq 0 ]; then
rm -fr /var/log/stat-logs/$VAR1
else
ftp -n 192.168.1.5 < ./script5;
fi
С уважением,
Овечкин Влад.
P.S. Такая проверка нужна на случай перегрызенного мышами сетевого
провода или пьяного электрика;)
next reply other threads:[~2005-05-26 10:02 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-05-26 10:02 Овечкин Влад [this message]
2005-05-26 10:28 ` [Comm] " Michael Shigorin
2005-05-26 10:30 ` [Comm] " Roman V. Tutov
2005-05-26 10:45 ` Овечкин Влад
2005-05-26 10:48 ` Genix
2005-05-26 12:55 ` [Comm] " Vitaly Ostanin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=42959EB8.6030103@rrnn.ru \
--to=test@rrnn.ru \
--cc=community@altlinux.ru \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
ALT Linux Community general discussions
This inbox may be cloned and mirrored by anyone:
git clone --mirror http://lore.altlinux.org/community/0 community/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 community community/ http://lore.altlinux.org/community \
mandrake-russian@linuxteam.iplabs.ru community@lists.altlinux.org community@lists.altlinux.ru community@lists.altlinux.com
public-inbox-index community
Example config snippet for mirrors.
Newsgroup available over NNTP:
nntp://lore.altlinux.org/org.altlinux.lists.community
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git