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

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

긴 이야기 짧게

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

그렇지 않은 경우 기능 요청을 수락하는 RSnapshot 커뮤니티가 있습니까?

TL 부분만...

몇 가지 문제 해결(아래 참조) 후에 rsnapshot과 rsync의 특정 조합이 더 이상 이전처럼 작동하지 않는 것 같습니다. 특히, 이제 rsync의 출력은 .rsync의 세부 설정에 관계없이 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의 불필요한 정보가 콘솔 출력에 나타납니다(자세한 1 설정에도 불구하고). 노이즈를 억제한 다음 rsnapshot 로그에서 올바른 정보를 수집하려면 "래퍼" 스크립트가 필요한 것 같습니다. 이는 오류가 발생하기 쉬운 프로세스로 보이며 업그레이드로 인해 해결 방법의 덕트 테이프 특성이 손상되므로 유지 관리 비용이 매우 많이 들 수 있습니다.

가장 저렴한 방법은 rsync 전송의 효율성에 대한 통계를 얻는 것을 포기하는 것 같습니다. 이를 통해 rsync 성공/실패를 읽기 쉽게 모니터링하고 실패할 경우 쉽게 다시 실행할 수 있습니다.

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

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기본값이 변경되었는지 여부가 명시되어야 하지만 고유한 정의를 사용하면 해당 문제를 완전히 우회할 수 있습니다.

관련 정보