Архивы по Категориям: Фря

Сертификаты Let’s Encrypt и их практическое применение.

Наконец вышел из бетты проект Let’s Encrypt по выдаче бесплатных сертификатов для всех желающих.

Let’s Encrypt — это некоммерческая инициатива, предоставляющая бесплатный, автоматизированный и открытый CA (certificate authority — центр сертификации), созданный ISRG на благо общества.

Решил опробовать его на своем блоге. В итоге по тесту SSLLabs имеем класс секретности «А»

Снимок экрана 2015-12-08 в 15.17.24

Вместе с изучением первоисточников процесс установки занял пару часов. Не будем спорить о принципе работы центра сертификации, сроках жизни сертификатов, необходимости автоматизировать процесс их получения да и вообще о том что продажа сертификатов в моем понимании приравнивается к продаже воздуха по заоблачным ценам.

Респект и уважуха проекту Let’s Encrypt.

В процессе использовались материалы:
Let’s Encrypt on a FreeBSD NGINX reverse proxy
Let’s Encrypt выходит в публичную бету: HTTPS всюду, каждому, отныне и навсегда бесплатно
Setting up HSTS in nginx

Лег диск в рейде на hetzner

В очередной раз. С момента прошлой замены прошло 224 дня.

camcontrol devlist

<ST3750528AS CC46> at scbus0 target 0 lun 0 (ada0,pass0)
<WDC WD7500AALX-009BA0 15.01H15> at scbus1 target 0 lun 0 (ada1,pass1)

root@mx1/root> ls /dev/ada?
/dev/ada0 /dev/ada1

root@mx1/root> gmirror status
Name Status Components
mirror/gm0 DEGRADED ada1s1 (ACTIVE)
root@mx1/root>

битый диск прожил 23757 hours (989 days + 21 hours). ну что ж…

[su_spoiler]

root@mx1/usr/home/vvs>
root@mx1/usr/home/vvs> /usr/local/sbin/smartctl -a /dev/ada0
smartctl 6.4 2015-06-04 r4109 [FreeBSD 9.3-STABLE amd64] (local build)
Copyright (C) 2002-15, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Family: Western Digital Blue
Device Model: WDC WD7500AALX-009BA0
Serial Number: WD-WCATR7461233
LU WWN Device Id: 5 0014ee 25b4c70ec
Firmware Version: 15.01H15
User Capacity: 750 156 374 016 bytes [750 GB]
Sector Size: 512 bytes logical/physical
Device is: In smartctl database [for details use: -P show]
ATA Version is: ATA8-ACS (minor revision not indicated)
SATA Version is: SATA 3.0, 6.0 Gb/s (current: 3.0 Gb/s)
Local Time is: Tue Jul 28 10:03:05 2015 EEST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

General SMART Values:
Offline data collection status: (0x82) Offline data collection activity
was completed without error.
Auto Offline Data Collection: Enabled.
Self-test execution status: ( 0) The previous self-test routine completed
without error or no self-test has ever
been run.
Total time to complete Offline
data collection: (11100) seconds.
Offline data collection
capabilities: (0x7b) SMART execute Offline immediate.
Auto Offline data collection on/off support.
Suspend Offline collection upon new
command.
Offline surface scan supported.
Self-test supported.
Conveyance Self-test supported.
Selective Self-test supported.
SMART capabilities: (0x0003) Saves SMART data before entering
power-saving mode.
Supports SMART auto save timer.
Error logging capability: (0x01) Error logging supported.
General Purpose Logging supported.
Short self-test routine
recommended polling time: ( 2) minutes.
Extended self-test routine
recommended polling time: ( 130) minutes.
Conveyance self-test routine
recommended polling time: ( 5) minutes.
SCT capabilities: (0x3037) SCT Status supported.
SCT Feature Control supported.
SCT Data Table supported.

SMART Attributes Data Structure revision number: 16
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
1 Raw_Read_Error_Rate 0x002f 200 200 051 Pre-fail Always - 0
3 Spin_Up_Time 0x0027 199 178 021 Pre-fail Always - 3050
4 Start_Stop_Count 0x0032 100 100 000 Old_age Always - 31
5 Reallocated_Sector_Ct 0x0033 200 200 140 Pre-fail Always - 0
7 Seek_Error_Rate 0x002e 100 253 000 Old_age Always - 0
9 Power_On_Hours 0x0032 070 070 000 Old_age Always - 22524
10 Spin_Retry_Count 0x0032 100 253 000 Old_age Always - 0
11 Calibration_Retry_Count 0x0032 100 253 000 Old_age Always - 0
12 Power_Cycle_Count 0x0032 100 100 000 Old_age Always - 28
192 Power-Off_Retract_Count 0x0032 200 200 000 Old_age Always - 24
193 Load_Cycle_Count 0x0032 200 200 000 Old_age Always - 6
194 Temperature_Celsius 0x0022 107 090 000 Old_age Always - 40
196 Reallocated_Event_Count 0x0032 200 200 000 Old_age Always - 0
197 Current_Pending_Sector 0x0032 200 200 000 Old_age Always - 0
198 Offline_Uncorrectable 0x0030 200 200 000 Old_age Offline - 0
199 UDMA_CRC_Error_Count 0x0032 200 200 000 Old_age Always - 0
200 Multi_Zone_Error_Rate 0x0008 200 200 000 Old_age Offline - 0

SMART Error Log Version: 1
No Errors Logged

SMART Self-test log structure revision number 1
Num Test_Description Status Remaining LifeTime(hours) LBA_of_first_error
# 1 Extended offline Completed without error 00% 22513 -
# 2 Extended offline Completed without error 00% 22506 -
# 3 Extended offline Completed without error 00% 21234 -
# 4 Extended offline Completed without error 00% 21160 -
# 5 Extended offline Completed without error 00% 17275 -
# 6 Extended offline Completed without error 00% 17249 -
# 7 Extended offline Completed without error 00% 12639 -
# 8 Extended offline Completed without error 00% 11053 -

SMART Selective self-test log data structure revision number 1
SPAN MIN_LBA MAX_LBA CURRENT_TEST_STATUS
1 0 0 Not_testing
2 0 0 Not_testing
3 0 0 Not_testing
4 0 0 Not_testing
5 0 0 Not_testing
Selective self-test flags (0x0):
After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.

root@mx1/usr/home/vvs>

[/su_spoiler]

[su_spoiler]

root@mx1/usr/home/vvs>
root@mx1/usr/home/vvs> /usr/local/sbin/smartctl -a /dev/ada0
smartctl 6.4 2015-06-04 r4109 [FreeBSD 9.3-STABLE amd64] (local build)
Copyright (C) 2002-15, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Family: Western Digital Blue
Device Model: WDC WD7500AALX-009BA0
Serial Number: WD-WCATR7461233
LU WWN Device Id: 5 0014ee 25b4c70ec
Firmware Version: 15.01H15
User Capacity: 750 156 374 016 bytes [750 GB]
Sector Size: 512 bytes logical/physical
Device is: In smartctl database [for details use: -P show]
ATA Version is: ATA8-ACS (minor revision not indicated)
SATA Version is: SATA 3.0, 6.0 Gb/s (current: 3.0 Gb/s)
Local Time is: Tue Jul 28 10:03:05 2015 EEST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

General SMART Values:
Offline data collection status: (0x82) Offline data collection activity
was completed without error.
Auto Offline Data Collection: Enabled.
Self-test execution status: ( 0) The previous self-test routine completed
without error or no self-test has ever
been run.
Total time to complete Offline
data collection: (11100) seconds.
Offline data collection
capabilities: (0x7b) SMART execute Offline immediate.
Auto Offline data collection on/off support.
Suspend Offline collection upon new
command.
Offline surface scan supported.
Self-test supported.
Conveyance Self-test supported.
Selective Self-test supported.
SMART capabilities: (0x0003) Saves SMART data before entering
power-saving mode.
Supports SMART auto save timer.
Error logging capability: (0x01) Error logging supported.
General Purpose Logging supported.
Short self-test routine
recommended polling time: ( 2) minutes.
Extended self-test routine
recommended polling time: ( 130) minutes.
Conveyance self-test routine
recommended polling time: ( 5) minutes.
SCT capabilities: (0x3037) SCT Status supported.
SCT Feature Control supported.
SCT Data Table supported.

SMART Attributes Data Structure revision number: 16
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
1 Raw_Read_Error_Rate 0x002f 200 200 051 Pre-fail Always - 0
3 Spin_Up_Time 0x0027 199 178 021 Pre-fail Always - 3050
4 Start_Stop_Count 0x0032 100 100 000 Old_age Always - 31
5 Reallocated_Sector_Ct 0x0033 200 200 140 Pre-fail Always - 0
7 Seek_Error_Rate 0x002e 100 253 000 Old_age Always - 0
9 Power_On_Hours 0x0032 070 070 000 Old_age Always - 22524
10 Spin_Retry_Count 0x0032 100 253 000 Old_age Always - 0
11 Calibration_Retry_Count 0x0032 100 253 000 Old_age Always - 0
12 Power_Cycle_Count 0x0032 100 100 000 Old_age Always - 28
192 Power-Off_Retract_Count 0x0032 200 200 000 Old_age Always - 24
193 Load_Cycle_Count 0x0032 200 200 000 Old_age Always - 6
194 Temperature_Celsius 0x0022 107 090 000 Old_age Always - 40
196 Reallocated_Event_Count 0x0032 200 200 000 Old_age Always - 0
197 Current_Pending_Sector 0x0032 200 200 000 Old_age Always - 0
198 Offline_Uncorrectable 0x0030 200 200 000 Old_age Offline - 0
199 UDMA_CRC_Error_Count 0x0032 200 200 000 Old_age Always - 0
200 Multi_Zone_Error_Rate 0x0008 200 200 000 Old_age Offline - 0

SMART Error Log Version: 1
No Errors Logged

SMART Self-test log structure revision number 1
Num Test_Description Status Remaining LifeTime(hours) LBA_of_first_error
# 1 Extended offline Completed without error 00% 22513 -
# 2 Extended offline Completed without error 00% 22506 -
# 3 Extended offline Completed without error 00% 21234 -
# 4 Extended offline Completed without error 00% 21160 -
# 5 Extended offline Completed without error 00% 17275 -
# 6 Extended offline Completed without error 00% 17249 -
# 7 Extended offline Completed without error 00% 12639 -
# 8 Extended offline Completed without error 00% 11053 -

SMART Selective self-test log data structure revision number 1
SPAN MIN_LBA MAX_LBA CURRENT_TEST_STATUS
1 0 0 Not_testing
2 0 0 Not_testing
3 0 0 Not_testing
4 0 0 Not_testing
5 0 0 Not_testing
Selective self-test flags (0x0):
After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.

root@mx1/usr/home/vvs>

[/su_spoiler]

разбираем gmirror

gmirror forget gm0

и пишем письмо в поддержку.
Good day.
We are experiencing problems with the hard drive Seagate Barracuda w serial number 9VP2SZL7.
It is subject to physical change. Kindly requested to replace the drive as quickly as possible.

Please don’t take any other actions except HDD replacement – don’t install recoverty image, etc.

Thanks in advance!

ну что я могу сказать — заменили за пол часа.
после замены

[su_spoiler]

root@mx1/usr/home/vvs>
root@mx1/usr/home/vvs> /usr/local/sbin/smartctl -a /dev/ada0
smartctl 6.4 2015-06-04 r4109 [FreeBSD 9.3-STABLE amd64] (local build)
Copyright (C) 2002-15, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Family: Western Digital Blue
Device Model: WDC WD7500AALX-009BA0
Serial Number: WD-WCATR7461233
LU WWN Device Id: 5 0014ee 25b4c70ec
Firmware Version: 15.01H15
User Capacity: 750 156 374 016 bytes [750 GB]
Sector Size: 512 bytes logical/physical
Device is: In smartctl database [for details use: -P show]
ATA Version is: ATA8-ACS (minor revision not indicated)
SATA Version is: SATA 3.0, 6.0 Gb/s (current: 3.0 Gb/s)
Local Time is: Tue Jul 28 10:03:05 2015 EEST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

General SMART Values:
Offline data collection status: (0x82) Offline data collection activity
was completed without error.
Auto Offline Data Collection: Enabled.
Self-test execution status: ( 0) The previous self-test routine completed
without error or no self-test has ever
been run.
Total time to complete Offline
data collection: (11100) seconds.
Offline data collection
capabilities: (0x7b) SMART execute Offline immediate.
Auto Offline data collection on/off support.
Suspend Offline collection upon new
command.
Offline surface scan supported.
Self-test supported.
Conveyance Self-test supported.
Selective Self-test supported.
SMART capabilities: (0x0003) Saves SMART data before entering
power-saving mode.
Supports SMART auto save timer.
Error logging capability: (0x01) Error logging supported.
General Purpose Logging supported.
Short self-test routine
recommended polling time: ( 2) minutes.
Extended self-test routine
recommended polling time: ( 130) minutes.
Conveyance self-test routine
recommended polling time: ( 5) minutes.
SCT capabilities: (0x3037) SCT Status supported.
SCT Feature Control supported.
SCT Data Table supported.

SMART Attributes Data Structure revision number: 16
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
1 Raw_Read_Error_Rate 0x002f 200 200 051 Pre-fail Always - 0
3 Spin_Up_Time 0x0027 199 178 021 Pre-fail Always - 3050
4 Start_Stop_Count 0x0032 100 100 000 Old_age Always - 31
5 Reallocated_Sector_Ct 0x0033 200 200 140 Pre-fail Always - 0
7 Seek_Error_Rate 0x002e 100 253 000 Old_age Always - 0
9 Power_On_Hours 0x0032 070 070 000 Old_age Always - 22524
10 Spin_Retry_Count 0x0032 100 253 000 Old_age Always - 0
11 Calibration_Retry_Count 0x0032 100 253 000 Old_age Always - 0
12 Power_Cycle_Count 0x0032 100 100 000 Old_age Always - 28
192 Power-Off_Retract_Count 0x0032 200 200 000 Old_age Always - 24
193 Load_Cycle_Count 0x0032 200 200 000 Old_age Always - 6
194 Temperature_Celsius 0x0022 107 090 000 Old_age Always - 40
196 Reallocated_Event_Count 0x0032 200 200 000 Old_age Always - 0
197 Current_Pending_Sector 0x0032 200 200 000 Old_age Always - 0
198 Offline_Uncorrectable 0x0030 200 200 000 Old_age Offline - 0
199 UDMA_CRC_Error_Count 0x0032 200 200 000 Old_age Always - 0
200 Multi_Zone_Error_Rate 0x0008 200 200 000 Old_age Offline - 0

SMART Error Log Version: 1
No Errors Logged

SMART Self-test log structure revision number 1
Num Test_Description Status Remaining LifeTime(hours) LBA_of_first_error
# 1 Extended offline Completed without error 00% 22513 -
# 2 Extended offline Completed without error 00% 22506 -
# 3 Extended offline Completed without error 00% 21234 -
# 4 Extended offline Completed without error 00% 21160 -
# 5 Extended offline Completed without error 00% 17275 -
# 6 Extended offline Completed without error 00% 17249 -
# 7 Extended offline Completed without error 00% 12639 -
# 8 Extended offline Completed without error 00% 11053 -

SMART Selective self-test log data structure revision number 1
SPAN MIN_LBA MAX_LBA CURRENT_TEST_STATUS
1 0 0 Not_testing
2 0 0 Not_testing
3 0 0 Not_testing
4 0 0 Not_testing
5 0 0 Not_testing
Selective self-test flags (0x0):
After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.

root@mx1/usr/home/vvs>

[/su_spoiler]
диск впердолили такой же старый. за новый просят 41 ойро.

9 Power_On_Hours 0x0032 070 070 000 Old_age Always — 22524

попробуем сколько протянет этот диск.

вставляем его в gmirror и ждем конца синхронизации …

root@mx1/usr/home/vvs> gmirror insert gm0 /dev/ada0

root@mx1/usr/home/vvs> gmirror status
Name Status Components
mirror/gm0 DEGRADED ada1s1 (ACTIVE)
ada0 (SYNCHRONIZING, 0%)
root@mx1/usr/home/vvs>

freebsd, php, extensions.ini

cat /usr/local/etc/php/extensions.ini | sort > /usr/local/etc/php/extensions.ini_new

cp /usr/local/etc/php/extensions.ini_new /usr/local/etc/php/extensions.ini

apachectl restart

еще можно переносить в самый конец

extension=mysql.so
extension=mysqli.so
extension=imap.so
extension=sockets.so
extension=memcache.so

 

spamassassin, razor

Razor2 port 2307 TCP — открыть

#mkdir /usr/local/var/razor
#razor-admin -home=/usr/local/var/razor -register
#razor-admin -home=/usr/local/var/razor -create
#razor-admin -d -home=/usr/local/var/razor -discover

spamassassin
local.cf

#razor
use_razor2 1
razor_config /usr/local/var/razor/razor-agent.conf

score RAZOR2_CHECK 2.500
score PYZOR_CHECK 2.500
score DCC_CHECK 4.000

vim /usr/local/var/razor/razor-agent.conf

добавить
razorhome = /usr/local/var/razor/

проверяем

spamassassin -t -D razor2 < 111.eml spamassassin -t -D dcc < 111.eml

найти самые большие 10 файлов

[cce]
du -a /var | sort -n -r | head -n 15
[/cce]

Увеличиваем размер аттача в postfix

[cc]
postconf | grep message_size_limit
postconf -e message_size_limit=52428800
[/cce]

 

быстрый способ найти самые большие файлы

[cce]
du -a /var | sort -n -r | head -n 10
[/cce]

синхронизация каталогов lftp/mirror

синхронизировать локальный каталог с удалённым:
$ lftp -e ‘mirror -e каталог-на-сервере локальный-каталог; bye;’ -u логин,пароль удалённый.хост

И наоборот, выложить локальный каталог на удалённый сервер:
$ lftp -e ‘mirror -R локальный-каталог каталог-на-сервере; bye;’ -u логин,пароль удалённый.хост

вот еще …

[cc lang=bash]
#!/bin/bash
HOST=»your.ftp.host.dom»
USER=»username»
PASS=»password»
LCD=»/path/of/your/local/dir»
RCD=»/path/of/your/remote/dir»
lftp -c «set ftp:list-options -a;
open ftp://$USER:$PASS@$HOST;
lcd $LCD;
cd $RCD;
mirror —reverse \
—delete \
—verbose \
—exclude-glob a-dir-to-exclude/ \
—exclude-glob a-file-to-exclude \
—exclude-glob a-file-group-to-exclude* \
—exclude-glob other-files-to-exclude»
[/cc]

duplicity cleanup

смотрим статус бэкапа
[cc]
vvs@mx1~> sudo duplicity collection-status ftp://u****8:jN********S@u3****8.your-backup.de/backup
NcFTP version is 3.2.5
Synchronizing remote metadata to local cache…
Warning, found incomplete backup sets, probably left from aborted session
Last full backup date: Fri Feb 1 08:00:41 2013
Collection Status
——————
Connecting with backend: FTPBackend
Archive dir: /home/vvs/.cache/duplicity/9e5b02f74546515e6b01654f2e790d20

Found 1 secondary backup chain.
Secondary chain 1 of 1:
————————-
Chain start time: Tue Jan 29 16:39:24 2013
Chain end time: Thu Jan 31 08:00:39 2013
Number of contained backup sets: 11
Total number of contained volumes: 778
Type of backup set: Time: Num volumes:
Full Tue Jan 29 16:39:24 2013 748
Incremental Tue Jan 29 21:40:21 2013 1
Incremental Tue Jan 29 22:02:24 2013 1
Incremental Tue Jan 29 23:00:49 2013 1
Incremental Wed Jan 30 00:00:07 2013 1
Incremental Wed Jan 30 01:00:10 2013 1
Incremental Wed Jan 30 02:00:32 2013 1
Incremental Wed Jan 30 03:01:26 2013 1
Incremental Wed Jan 30 13:20:08 2013 11
Incremental Wed Jan 30 13:25:08 2013 1
Incremental Thu Jan 31 08:00:39 2013 11
————————-

Found primary backup chain with matching signature chain:
————————-
Chain start time: Fri Feb 1 08:00:41 2013
Chain end time: Fri Feb 1 08:00:41 2013
Number of contained backup sets: 1
Total number of contained volumes: 758
Type of backup set: Time: Num volumes:
Full Fri Feb 1 08:00:41 2013 758
————————-
Also found 0 backup sets not part of any chain,
and 2 incomplete backup sets.
These may be deleted by running duplicity with the «cleanup» command.
[/cc]

видим
Warning, found incomplete backup sets, probably left from aborted session

[cc]
sudo duplicity cleanup —force —old-filenames ftp://u****8:jN********S@u3****8.your-backup.de/backup

[/cc]

Делам backup на amazon s3

Ну о пользе делать бэкапы мы дискутировать не будем. Что то ночью мне приснилось что бэкапы на домашнем нас-е (который по совместительству еще и медиа плеер) держать как то не совсем правильно, а если правильно то этого не достаточно.

Посему было принято решение разместить для начала бэкапы баз форума сайта и блога на сервисах Amazon S3. Для архивирования данных в последствии будет использован Amazon Glacier.

Эта статья — поиск правильного решения. Попробую несколько.

Стоимость своего бэкапа я пытался честно расчитать используя калькулятор амазона,

плюнул и решил посмотреть по результата.

Зарешестрировал аккаунт на Amazon S3 и прицепил к нему виртуальную карту QIWI.

для начала пробуем s3cmd
[cc]
oot@mx1/usr/ports> make search name=s3cmd
Port: py27-s3cmd-1.0.1_1
Path: /usr/ports/net/py-s3cmd
Info: Unix-like tools to manipulate stored files from the command line
Maint: clsung@FreeBSD.org
B-deps: gettext-0.18.1.1 libiconv-1.14 python27-2.7.3_6
R-deps: gettext-0.18.1.1 libiconv-1.14 python27-2.7.3_6
WWW: http://s3tools.logix.cz/s3cmd
[/cc]

gnupg для шифрования у меня уже стоит

[cc]
root@mx1/usr/ports> pkg_info | grep gnupg
gnupg-2.0.19_3 The GNU Privacy Guard
root@mx1/usr/ports>
[/cc]

[cc]
root@mx1/usr/ports/net/py-s3cmd> make install clean
[/cc]

процесс конфигурирования s3cmd интерактивный. запускаем:

[cc]
/usr/local/bin/s3cmd —configure
[/cc]

Свои Amazon secret key и access key смотрим тут

получаем

a href=»https://console.aws.amazon.com/s3/home?region=us-east-1″>создаем новый бакет на амазоне или из консоли.

[cc]
s3cmd mb s3://vslip1970
[/cc]

надо заметить что имя бакета должно быть уникально.

и бэкапим.

[cc]

root@mx1/usr/local> s3cmd sync /usr/local/backup/ s3://vslip1970/

WARNING: Redirected to: vslip1970.s3-external-3.amazonaws.com
/usr/local/backup/backup-hdtvzone -> s3://vslip1970/backup-hdtvzone [1 of 1943]
19826 of 19826 100% in 0s 93.51 kB/s done
/usr/local/backup/backup-satexpert -> s3://vslip1970/backup-satexpert [2 of 1943]
19841 of 19841 100% in 0s 103.93 kB/s done
/usr/local/backup/backup-sysb -> s3://vslip1970/backup-sysb [3 of 1943]
19899 of 19899 100% in 0s 96.16 kB/s done
/usr/local/backup/backup-vskiev -> s3://vslip1970/backup-vskiev [4 of 1943]

[/cc]

в итоге

[cc]
/usr/local/backup/vs-kiev/weekly/vs-wordp/vs-wordp_week.52.2012-12-29.sql.gz -> s3://vslip1970/vs-kiev/weekly/vs-wordp/vs-wordp_week.52.2012-12-29.sql.gz [1943 of 1943]
687940 of 687940 100% in 0s 1476.63 kB/s done
Done. Uploaded 40280736969 bytes in 6510.5 seconds, 5.90 MB/s

[/cc]

далее эта задача ставится в cron

PS если почистил локальную директорию с бэкапами то

[cc]
s3cmd sync —skip-existing —delete-remove /usr/local/backup/ s3://vslip1970/
[/cc]

Как восстановить данные?

Чтобы восстановить все данные из S3, в команде синхронизации меняем местами источник и цель, не забывая убрать удаление отсутсвующих файлов:

s3cmd sync s3://mybucketname/backupfolder /local/backup/dir/
Происходит синхронизация в обратную сторону.

Либо, для восстановления одного файла, воспользуемся командой get:
s3cmd get s3://mybucketname/backupfolder/backup.tar.gz /local/backup/dir/