rsnapshot.conf - 원하는 효과가 없는 장황한 매개변수를 줄이시겠습니까?

rsnapshot.conf - 원하는 효과가 없는 장황한 매개변수를 줄이시겠습니까?

TL;DR

rsync가 원하는 세부 수준을 생성하고 기록하도록 하면서 rsnapshot 자체에서 생성된 셸 명령, 오류 및 시작/종료 알림으로 출력을 제한할 수 있는 rsnapshot(아래 버전 참조)에 대한 일부 구성이 있습니까?오직rsync 로그 파일에? 아니면 더 간결하게 말하면, rsnapshot 출력 결과가 rsnapshot 구성 파일의 자세한 설명과 일치하도록 할 수 있습니까?

그렇지 않다면 기능 요청을 받는 RSnapshot 커뮤니티가 있습니까?

TL 부분만...

몇 가지 문제 해결(아래 참조) 후에 rsnapshot과 rsync의 특정 조합이 지난 몇 년 동안 그랬던 것처럼 더 이상 작동하지 않는 것으로 나타났습니다. 특히, 이제 rsync의 출력은 .NET의 자세한 설정에 관계없이 rsnapshot의 콘솔 출력에 표시됩니다 rsnapshot.conf. FreeBSD 12.2를 새로 설치했습니다.

freebsd-version   
12.2-RELEASE-p10

rsync는 의 일부로 설치되었으며 다음을 보여줍니다 pkg install rsnapshot.rsync -V

rsync  version 3.2.3  protocol version 31
Copyright (C) 1996-2020 by Andrew Tridgell, Wayne Davison, and others.
Web site: https://rsync.samba.org/
Capabilities:
    64-bit files, 64-bit inums, 64-bit timestamps, 64-bit long ints,
    socketpairs, hardlinks, hardlink-specials, symlinks, IPv6, atimes,
    batchfiles, inplace, append, ACLs, xattrs, optional protect-args, iconv,
    symtimes, no prealloc, stop-at, no crtimes, file-flags
Optimizations:
    no SIMD, no asm, openssl-crypto
Checksum list:
    xxh128 xxh3 xxh64 (xxhash) md5 md4 none
Compress list:
    zstd lz4 zlibx zlib none

rsnapshot의 현재 버전은 다음과 같습니다.

my $VERSION = '1.4.4';

이 질문의 원래 형식을 게시하고 잠자기한 후 앞서 언급한 문제 해결과 함께 문제는 다음과 같이 요약됩니다. rsnapshot은 crontab에서 실행되고 rsync의 불필요한 정보가 콘솔 출력에 나타납니다(verbose 1 설정에도 불구하고). 노이즈를 억제한 다음 rsnapshot 로그에서 올바른 정보를 조합하려면 "래퍼" 스크립트가 필요한 것 같습니다. 이는 오류가 발생하기 쉬운 프로세스로 보이며, 업그레이드로 인해 해결 방법의 덕트 테이프 특성이 깨지기 때문에 유지 관리가 매우 많이 필요할 가능성이 높습니다.

최소 비용 경로는 rsync 전송의 효율성에 대한 통계 정보를 얻는 것을 포기하는 것 같습니다. 이를 통해 rsync의 성공/실패를 모니터링하기 위한 가독성을 유지하고 실패할 경우 쉽게 다시 실행할 수 있습니다.

확실히 뭔가 변경된 것 같습니다. rsync(암시적 -v 설정?)가 의심되고, rsnapshot 출력에서 ​​원하는 내용(셸 명령, 오류 및 시작/종료 알림만)을 얻을 수 있는 구성이 있는 경우 rsync 로그 파일에 rsync 출력을 기록하는 것에 대해 꼭 알고 싶습니다.

RSnapshot 체제는 2018년부터 완벽하게 실행되어 왔으며 FreeBSD 12.2를 새로 설치해야만 중단되었습니다. 이전 rsnapshot 체제는 업그레이드된 FreeBSD 12.1(10.x로 시작)에서 (동일한 하드웨어에서) 실행되었습니다. rsync 및 rsnapshot은 원래 FreeBSD 10.x 포트와 별도로(순서대로) 구축되었으며 그 이후로 portmaster를 사용하여 정기적으로 업그레이드되었습니다.

이번에는 (언급한 대로) pkg를 사용하여 rsnapshot을 설치하고 rsync(및 기타 필요한 모든 것)를 설치하도록 했습니다.

rsnapshot.conf는 백업 지점의 값 snapshot_root과 단축된 목록만 변경되었습니다.

모니터링 이메일에 대해 내가 원하는(처리하기 쉬운) 출력은 다음과 같습니다(즉, rsync 노이즈가 전혀 없음).

Wed Oct 20 21:40:00 PDT 2021
=================================================================

echo 98875 > /var/run/rsnapshot.pid 
mv /obo-offsitepool/archives/daily.5/ /obo-offsitepool/archives/daily.6/ 
mv /obo-offsitepool/archives/daily.4/ /obo-offsitepool/archives/daily.5/ 
mv /obo-offsitepool/archives/daily.3/ /obo-offsitepool/archives/daily.4/ 
mv /obo-offsitepool/archives/daily.2/ /obo-offsitepool/archives/daily.3/ 
mv /obo-offsitepool/archives/daily.1/ /obo-offsitepool/archives/daily.2/ 
native_cp_al("/obo-offsitepool/archives/daily.0", \
    "/obo-offsitepool/archives/daily.1") 
/usr/local/bin/rsync -a --delete --numeric-ids \
    /obo-offsitepool/archives/daily.0/ /obo-offsitepool/archives/daily.1/ 
/usr/local/bin/rsync -rltv --chmod D0770,F0660 --delete --relative \
    --delete-excluded --partial --stats --log-file=/var/log/rsync \
    --human-readable \
    --exclude-from=/obo-offsitepool/archives/.rsnapshot_excludes \
    /usr/local/etc/ \
    /obo-offsitepool/archives/daily.0/obo-offsite1/local_etc/ 
/usr/local/bin/rsync -rltv --chmod D0770,F0660 --delete --relative \
    --delete-excluded --partial --stats --log-file=/var/log/rsync \
    --human-readable \
    --exclude-from=/obo-offsitepool/archives/.rsnapshot_excludes \
    192.168.18.3::srv330-group/ \
    /obo-offsitepool/archives/daily.0/CSO/srv330-group 
... etc

이 대신에(백업 지점이 20개가 넘는다는 점을 염두에 두십시오. 많은 지점에는 원치 않는 rsync 출력이 수백 줄에 달합니다):

Tue Oct 26 18:55:00 PDT 2021
=================================================================

echo 97810 > /var/run/rsnapshot.pid 
/bin/rm -rf /obopool/archives/daily.6/ 
mv /obopool/archives/daily.5/ /obopool/archives/daily.6/ 
mv /obopool/archives/daily.4/ /obopool/archives/daily.5/ 
mv /obopool/archives/daily.3/ /obopool/archives/daily.4/ 
mv /obopool/archives/daily.2/ /obopool/archives/daily.3/ 
mv /obopool/archives/daily.1/ /obopool/archives/daily.2/ 
native_cp_al("/obopool/archives/daily.0", \
    "/obopool/archives/daily.1") 
/usr/local/bin/rsync -a --delete --numeric-ids \
    /obopool/archives/daily.0/ /obopool/archives/daily.1/ 
/usr/local/bin/rsync -rltv --chmod D0770,F0660 --delete --relative \
    --delete-excluded --partial --stats --log-file=/var/log/rsync \
    --human-readable \
    --exclude-from=/obopool/archives/.rsnapshot_excludes /usr/local/etc/ \
    /obopool/archives/daily.0/offsite1/local_etc/ 
sending incremental file list
/usr/
deleting usr/local/etc/ssmtp/ssmtp.conf.sample
deleting usr/local/etc/ssmtp/ssmtp.conf.2021-01-20
deleting usr/local/etc/ssmtp/ssmtp.conf
deleting usr/local/etc/ssmtp/revaliases.sample
deleting usr/local/etc/ssmtp/revaliases
deleting usr/local/etc/ssmtp/
deleting usr/local/etc/dma/dma.conf.sample
deleting usr/local/etc/dma/dma.conf
deleting usr/local/etc/dma/auth.conf.sample
deleting usr/local/etc/dma/auth.conf
deleting usr/local/etc/dma/
deleting usr/local/etc/portmaster.rc.sample
deleting usr/local/etc/papersize.letter
deleting usr/local/etc/papersize.a4
deleting usr/local/etc/bash_completion.d/portmaster.sh
deleting usr/local/etc/rc.d/dma_flushq
/usr/local/
/usr/local/etc/
/usr/local/etc/rsnapshot.conf
/usr/local/etc/rsnapshot.conf.default
/usr/local/etc/rsnapshot.conf_2018-09-08
/usr/local/etc/rsnapshot.conf_2019-06-14
/usr/local/etc/rsnapshot.conf_2019-08-23
/usr/local/etc/rsnapshot.conf_2021-02-01
/usr/local/etc/rsnapshot.conf_2021-06-21
/usr/local/etc/screenrc
/usr/local/etc/screenrc.sample
/usr/local/etc/smartd.conf
/usr/local/etc/smartd.conf.sample
/usr/local/etc/smartd_warning.sh
/usr/local/etc/bash_completion.d/
/usr/local/etc/man.d/
/usr/local/etc/man.d/perl5.conf
/usr/local/etc/newsyslog.conf.d/
/usr/local/etc/newsyslog.conf.d/rsnapshot
/usr/local/etc/newsyslog.conf.d/rsync
/usr/local/etc/newsyslog.conf.d/rsyncd
/usr/local/etc/periodic/
/usr/local/etc/periodic/daily/
/usr/local/etc/periodic/daily/smart
/usr/local/etc/periodic/security/
/usr/local/etc/periodic/weekly/
/usr/local/etc/rc.d/
/usr/local/etc/rc.d/rsyncd
/usr/local/etc/rc.d/smartd
/usr/local/etc/rc.d/uuidd
/usr/local/etc/rsync/
/usr/local/etc/rsync/rsyncd.conf
/usr/local/etc/rsync/rsyncd.conf.sample
/usr/local/etc/smartd_warning.d/
/usr/local/etc/ssl/
/usr/local/etc/ssl/cert.pem

Number of files: 46 (reg: 31, dir: 14, link: 1)
Number of created files: 4 (reg: 3, dir: 1)
Number of deleted files: 16 (reg: 14, dir: 2)
Number of regular files transferred: 23
Total file size: 774.49K bytes
Total transferred file size: 735.92K bytes
Literal data: 735.92K bytes
Matched data: 0 bytes
File list size: 0
File list generation time: 0.001 seconds
File list transfer time: 0.000 seconds
Total bytes sent: 738.45K
Total bytes received: 1.10K

sent 738.45K bytes  received 1.10K bytes  1.48M bytes/sec
total size is 774.49K  speedup is 1.05
/usr/local/bin/rsync -rltv --chmod D0770,F0660 --delete --relative \
    --delete-excluded --partial --stats --log-file=/var/log/rsync \
    --human-readable \
    --exclude-from=/obopool/archives/.rsnapshot_excludes \
    192.168.18.3::srv330-group/ \
    /obopool/archives/daily.0/CSO/srv330-group 
receiving incremental file list
CSO2/Lori/
CSO2/Lori/retail.prices2.docx
Retail/
...etc

위의 두 이메일 보고서는 모두 동일한 rsnapshot.conf 파일에서 생성되었습니다.

제가 해본 문제 해결 방법은 다음과 같습니다. 테스트 4는 이전에 했던 것과 가장 유사한 것입니다.

1
rsnapshot -v alpha && /root/scripts/marklogs.sh --> using default rsnapshot.conf with 
 entries for rsync_short_args AND rsync_long_args  were actually elided from file (not left with # symbol)
 - normal screen output (start notification, shell commands, success notification)
 - rsnapshot log shows same as monitor output, no rsync log output

2 Explicitly add in default settings to the rsnapshot.conf file  
rm -rf  /obopool/tester/alpha* && rsnapshot -v alpha  && /root/scripts/marklogs.sh #--> rsnapshot.conf modifed as shown:
 rsync_short_args        -a
 rsync_long_args         --delete --numeric-ids --relative --delete-excluded
  - same as previous 

3 change rsync_long_args
rm -rf  /obopool/tester/alpha* && rsnapshot -v alpha  && /root/scripts/marklogs.sh #--> rsnapshot.conf modifed from default as shown:
 rsync_short_args        -a
 rsync_long_args         --chmod D0770,F0660 --delete --relative --delete-excluded --partial --log-file=/var/log/rsync-test
 - console shows expected output (start notification, shell commands, success confirmations)
 - rsnapshot log shows same as monitor output
 - rsync log shows building file list, files xferred, sent/received/total summary line for each backup point
 
4 change rsync_short args
rm -rf  /obopool/tester/alpha* && rsnapshot -v alpha && /root/scripts/marklogs.sh  #--> rsnapshot.conf modifed from default as shown:
 rsync_short_args        -rlt
 rsync_long_args         --chmod D0770,F0660 --delete --relative --delete-excluded --partial --log-file=/var/log/rsync-test
 - normal console output (start notification, shell commands, success notification)
 - rsnapshot log shows same as console
 - rsync log shows building file list, files xferred, sent/received/total summary line for each backup point

5 change rsync_short_arg to add -v
rm -rf  /obopool/tester/alpha* && rsnapshot -v alpha && /root/scripts/marklogs.sh  #--> rsnapshot.conf modifed from default as shown:
 rsync_short_args        -rltv
 rsync_long_args         --chmod D0770,F0660 --delete --relative --delete-excluded --partial --log-file=/var/log/rsync-test
 - console shows the unexpected (and undesired), given verbose set at 2, rsync output
 - rsnapshog log is polluted with rsync output, shows the start notification & shell commands before the noise, then some closing shell commands (touch /obopool/tester/alpha.0/; rm -f /var/run/rsnapshot.pid) then the completion notification
 - rsync log adds one line, "total size ..... speedup is .....", to logged info.
  
6 change loglevel to 1 to see effect on rsnapshot log
rm -rf  /obopool/tester/alpha* && rsnapshot -v alpha && /root/scripts/marklogs.sh  #--> rsnapshot.conf modifed from default as shown:
 loglevel                  1
 rsync_short_args        -rltv
 rsync_long_args         --chmod D0770,F0660 --delete --relative --delete-excluded --partial --log-file=/var/log/rsync-test
 - console shows same polluted output (rsnapshot shell commands with rsync data)
 - rsnapshot log received no ouput
 - rsync log shows same (correct) output as previous execution

7 change verbose to 1 (quiet) in rsnapshot.conf
rm -rf  /obopool/tester/alpha* && rsnapshot -v alpha && /root/scripts/marklogs.sh  #--> rsnapshot.conf modifed as shown:
 verbose                 1
 loglevel                  1
 rsync_short_args        -rltv
 rsync_long_args         --chmod D0770,F0660 --delete --relative --delete-excluded --partial --log-file=/var/log/rsync-test
 - console - no change to output from test 6 
 - rsnapshot log received no ouput (expected with loglevel 1)
 - rsync log shows expected output (same as previous)

8 set loglevel to 2 to verify effect on rsnapshot log
rm -rf  /obopool/tester/alpha* && rsnapshot -v alpha && /root/scripts/marklogs.sh  #--> rsnapshot.conf modifed as shown:
 verbose                 1
 loglevel                  2
 rsync_short_args        -rltv
 rsync_long_args         --chmod D0770,F0660 --delete --relative --delete-excluded --partial --log-file=/var/log/rsync-test
 - console - no change
 - rshapshot log shows only start and completion notices (no shell commands). One assumes errors would show up.
 - rsync log shows expected output

9 variation on 4: default verbose/log level - no -v on rsync_short_args, and add --stats to rsync long args
rm -rf  /obopool/tester/alpha* && rsnapshot -v alpha && /root/scripts/marklogs.sh  #--> rsnapshot.conf modifed from default as shown:
 rsync_short_args        -rlt
 rsync_long_args         --chmod D0770,F0660 --delete --relative --delete-excluded --partial --log-file=/var/log/rsync-test --stats
 - console has stats (rsync) information mixed in with correct output (start notification, shell commands, success confirmations)
 - rshapshot log has the same issues as console: stats output mixed in with  expected output (start notification, shell commands, success confirmations)
 - rsync log shows expected output -- files plus stats.

/usr/local/etc/rsnapshot.conf이는 기록된 모든 변경 사항이 적용된 기본(설치된) 파일입니다 .

#/usr/local/etc/rsnapshot.conf
#################################################
# rsnapshot.conf - rsnapshot configuration file #
#################################################
#                                               #
# PLEASE BE AWARE OF THE FOLLOWING RULE:        #
#                                               #
# This file requires tabs between elements      #
#                                               #
#################################################

#######################
# CONFIG FILE VERSION #
#######################

config_version  1.2
snapshot_root   /obopool/tester
no_create_root  1
cmd_rm          /bin/rm
cmd_rsync       /usr/local/bin/rsync
cmd_logger      /usr/bin/logger
#cmd_rsnapshot_diff     /usr/local/bin/rsnapshot-diff

retain  alpha   6
retain  beta    7
retain  gamma   4
#retain delta   3

# Verbose level, 1 through 5.
# 1     Quiet           Print fatal errors only
# 2     Default         Print errors and warnings only
# 3     Verbose         Show equivalent shell commands being executed
# 4     Extra Verbose   Show extra verbose information
# 5     Debug mode      Everything
#
verbose         2

# Same as "verbose" above, but controls the amount of data sent to the
# logfile, if one is being used. The default is 3.
#
loglevel        3

logfile /var/log/rsnapshot-test
lockfile        /var/run/rsnapshot.pid


###############################
### BACKUP POINTS / SCRIPTS ###
###############################

# LOCALHOST
backup  /root/          localhost/
backup  /etc/           localhost/
backup  /usr/local/     localhost/
backup  /var/log/       localhost/

마지막으로 여기에 약간의 perl -V출력이 있습니다.

perl -V
Summary of my perl5 (revision 5 version 32 subversion 1) configuration:
   
  Platform:
    osname=freebsd
    osvers=12.2-release-p10
    archname=amd64-freebsd-thread-multi
    uname='freebsd 122amd64-quarterly-job-03 12.2-release-p10 freebsd 12.2-release-p10 amd64 '
    config_args='-Darchlib=/usr/local/lib/perl5/5.32/mach -Dcc=cc -Dcf_by=mat [email protected] -Dcf_time=Sat Jan 23 14:56:40 UTC 2021 -Dinc_version_list=none -Dlibperl=libperl.so.5.32.1 -Dman1dir=/usr/local/lib/perl5/5.32/perl/man/man1 -Dman3dir=/usr/local/lib/perl5/5.32/perl/man/man3 -Dprefix=/usr/local -Dprivlib=/usr/local/lib/perl5/5.32 -Dscriptdir=/usr/local/bin -Dsitearch=/usr/local/lib/perl5/site_perl/mach/5.32 -Dsitelib=/usr/local/lib/perl5/site_perl -Dsiteman1dir=/usr/local/lib/perl5/site_perl/man/man1 -Dsiteman3dir=/usr/local/lib/perl5/site_perl/man/man3 -Dusenm=n -Duseshrplib -sde -Ui_iconv -Ui_malloc -Uinstallusrbinperl -Accflags=-DUSE_THREAD_SAFE_LOCALE -Alddlflags=-L/wrkdirs/usr/ports/lang/perl5.32/work/perl-5.32.1 -L/usr/local/lib/perl5/5.32/mach/CORE -lperl -Dshrpldflags=$(LDDLFLAGS:N-L/wrkdirs/usr/ports/lang/perl5.32/work/perl-5.32.1:N-L/usr/local/lib/perl5/5.32/mach/CORE:N-lperl) -Wl,-soname,$(LIBPERL:R) -Doptimize=-O2 -pipe  -fstack-protector-strong -fno-strict-aliasing  -Dusedtrace -Ui_gdbm -Dusemultiplicity=y -Duse64bitint -Dusemymalloc=n -Dusethreads=y'

답변1

가 있는 것 같습니다 rsync -v. 제거 -v하면 rsync훨씬 조용해집니다.

rsync_short_args 처음에 및 가능한 값을 살펴보면 이를 확인할 수 있습니다 rsync_long_args. 다음은 내 구성의 예입니다.

rsync_short_args    -azHS
rsync_long_args     --delete --delete-excluded --numeric-ids --fake-super

이러한 값을 생략하면 기본값이 변경되지 않고 그대로 유지됩니다. 변경 로그는 rsnapshot기본값이 변경되었는지 선언해야 하지만 자체 정의를 사용하면 해당 문제를 완전히 우회할 수 있습니다.

관련 정보