Score:0

Why Would a Log File Get Cut Off When Emailed?

in flag

I am setting up some local backups of AWS EC2 instances. The backups are set to run overnight via Windows Server 2012 R2 Task Scheduler. The basic flow of each backup is that an rsync copies the current instance to local storage, the local storage copy is tarred and gzipped, and then an email is sent to me with any errors or notices (or a statement that no errors or notices were generated).

The problem is that several of the emails being sent to me are cut off. They only list the first 75-odd errors or notices, although the exact number varies.

What could be causing this truncation?

Update

As suggested in a comment, I sent the output variable to a text file prior to sending it in an email. That text file was itself truncated, so the problem is coming in within the batch file during the population of the output variable.

Here is a sample Windows batch file that executes the backup process:

REM Delete any pre-existing log file and create a fresh one.
del C:\scripts\errorLogs\instanceMSSCTest1error.log
fsutil.exe file createnew C:\scripts\errorLogs\instanceMSSCTest1error.log 0

REM Execute the rsync.
rsync -az --exclude "/data" --exclude "/dev" --exclude "/proc" --exclude "/snap" --exclude "/sys" --exclude "request" --exclude "orgChangeShowAll*" --exclude "httpdocs/content" -e "ssh -i //fszero/itdata/WebserverInformation/Keys/SSH_Keys/test-mssctraining.pem" [USER]@[IP ADDRESS]:/ "//fszero/webServerBackup/dailyBackups/MSSCTest1InstanceDaily/" --delete >> C:\scripts\errorLogs\instanceMSSCTest1error.log 2>&1

REM Get the current data via the GNU utility formerly known as "date" (renamed to avoid confusion with MS's built-in "date" command).
FOR /F "tokens=*" %%i IN ('gnudate +%%Y') DO (SET year=%%i)
FOR /F "tokens=*" %%i IN ('gnudate +%%m') DO (SET month=%%i)
FOR /F "tokens=*" %%i IN ('gnudate +%%d') DO (SET day=%%i)

REM Execute the archive using the date in the name.
C:\cygwin64\bin\tar.exe -czf //fszero/webServerBackup/dailyBackups/MSSCTest1InstanceArchives/instanceDailyMSSCTest1-%YEAR%-%MONTH%-%DAY%.tar.gz //fszero/webServerBackup/dailyBackups/MSSCTest1InstanceDaily/ >> C:\scripts\errorLogs\instanceMSSCTest1error.log 2>&1

REM Remove the lone back tick from tar output and replace it with a quote so it matches with the otherwise lone quote, set both to double-quotes so they will show up in text.
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -command "(gc C:\scripts\errorLogs\instanceMSSCTest1error.log).replace('Removing leading `', 'Removing leading ""') | Set-Content -encoding ASCII C:\scripts\errorLogs\instanceMSSCTest1error.log"
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -command "(gc C:\scripts\errorLogs\instanceMSSCTest1error.log).replace('//'' from member names', '//"" from member names') | Set-Content -encoding ASCII C:\scripts\errorLogs\instanceMSSCTest1error.log"

REM Turn on execution-time evaluation of variables rather than just parse-time.
SETLOCAL ENABLEDELAYEDEXPANSION

REM Initial variable declaration with HTML line break.
SET initial=The following errors or notices were issued:
SET break="<br>"
SET output=!initial!!break!

REM For loop to process each line in the text file and append it with a line break to the output.
FOR /f "tokens=*" %%l IN (C:\scripts\errorLogs\instanceMSSCTest1error.log) DO (
    SET output=!output!!break!%%l   
)

REM If an empty file (i.e. no change from initialization) say no errors or notices were issued.
IF (!output!==!initial!!break!) (
    SET output=No errors or notices were issued.
)

REM Remove the output quote introduced by the break variable.
SET output=%output:""=%

REM Send the email.
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -command C:\scripts\emailWithParameters.ps1 '1/10: Instance MSSC Test 1 Backup' '%output%'

Here is the separate Powershell script that executes the email:

Param([String]$mailSubject, [String]$body)
$smtpServer = 'smtp.gmail.com'  
$smtpPort = '587'
$smtpUser = '[USERID]@gmail.com'  
$smtpPassword = '[PASSWORD]'  
$mailtTo = '[DESTINATION EMAIL]'  
$mailFrom = '[SOURCE EMAIL]'  
$credentials = New-Object System.Management.Automation.PSCredential -ArgumentList $smtpUser, $($smtpPassword | ConvertTo-SecureString -AsPlainText -Force)
Send-MailMessage -To "$mailtTo" -From "$mailFrom" -Subject $mailSubject -Body "$body" -SmtpServer $smtpServer -Port $smtpPort -BodyAsHtml -UseSsl -Credential $credentials

Here is the full error log file output sitting on the server, with a notation added for where truncaction occurs:

rsync: send_files failed to open "/boot/System.map-5.11.0-1020-aws": Permission denied (13)
rsync: send_files failed to open "/boot/System.map-5.11.0-1021-aws": Permission denied (13)
rsync: send_files failed to open "/boot/System.map-5.11.0-1022-aws": Permission denied (13)
rsync: send_files failed to open "/boot/System.map-5.4.0-1045-aws": Permission denied (13)
rsync: send_files failed to open "/boot/vmlinuz-5.11.0-1020-aws": Permission denied (13)
rsync: send_files failed to open "/boot/vmlinuz-5.11.0-1021-aws": Permission denied (13)
rsync: send_files failed to open "/boot/vmlinuz-5.11.0-1022-aws": Permission denied (13)
rsync: send_files failed to open "/boot/vmlinuz-5.4.0-1045-aws": Permission denied (13)
rsync: opendir "/etc/multipath" failed: Permission denied (13)
rsync: send_files failed to open "/etc/.pwd.lock": Permission denied (13)
rsync: send_files failed to open "/etc/at.deny": Permission denied (13)
rsync: send_files failed to open "/etc/gshadow": Permission denied (13)
rsync: send_files failed to open "/etc/gshadow-": Permission denied (13)
rsync: send_files failed to open "/etc/shadow": Permission denied (13)
rsync: send_files failed to open "/etc/shadow-": Permission denied (13)
rsync: send_files failed to open "/etc/sudoers": Permission denied (13)
rsync: opendir "/etc/polkit-1/localauthority" failed: Permission denied (13)
rsync: opendir "/etc/ssl/private" failed: Permission denied (13)
rsync: opendir "/etc/sudoers.d" failed: Permission denied (13)
rsync: send_files failed to open "/etc/iscsi/initiatorname.iscsi": Permission denied (13)
rsync: send_files failed to open "/etc/iscsi/iscsid.conf": Permission denied (13)
rsync: opendir "/home/mssc_ftp/.cache" failed: Permission denied (13)
rsync: opendir "/lost+found" failed: Permission denied (13)
rsync: opendir "/root" failed: Permission denied (13)
rsync: send_files failed to open "/etc/mail/access": Permission denied (13)
rsync: send_files failed to open "/etc/mail/access.db": Permission denied (13)
rsync: send_files failed to open "/etc/mail/aliases.db": Permission denied (13)
rsync: send_files failed to open "/etc/mail/authinfo": Permission denied (13)
rsync: send_files failed to open "/etc/mail/authinfo.db": Permission denied (13)
rsync: send_files failed to open "/etc/mail/m4/dialup.m4": Permission denied (13)
rsync: send_files failed to open "/etc/mail/m4/provider.m4": Permission denied (13)
rsync: send_files failed to open "/etc/mail/tls/sendmail-client.cfg": Permission denied (13)
rsync: send_files failed to open "/etc/mail/tls/sendmail-common.key": Permission denied (13)
rsync: send_files failed to open "/etc/mail/tls/sendmail-common.prm": Permission denied (13)
rsync: send_files failed to open "/etc/mail/tls/sendmail-server.cfg": Permission denied (13)
rsync: opendir "/run/cryptsetup" failed: Permission denied (13)
rsync: opendir "/run/lock/lvm" failed: Permission denied (13)
rsync: opendir "/run/lvm" failed: Permission denied (13)
rsync: opendir "/run/sudo" failed: Permission denied (13)
rsync: opendir "/run/systemd/ask-password-block" failed: Permission denied (13)
rsync: opendir "/run/systemd/inaccessible" failed: Permission denied (13)
rsync: opendir "/run/systemd/unit-root" failed: Permission denied (13)
rsync: send_files failed to open "/etc/security/opasswd": Permission denied (13)
rsync: send_files failed to open "/etc/ssh/ssh_host_dsa_key": Permission denied (13)
rsync: send_files failed to open "/etc/ssh/ssh_host_ecdsa_key": Permission denied (13)
rsync: send_files failed to open "/etc/ssh/ssh_host_ed25519_key": Permission denied (13)
rsync: send_files failed to open "/etc/ssh/ssh_host_rsa_key": Permission denied (13)
rsync: opendir "/run/user/1000/inaccessible" failed: Permission denied (13)
rsync: opendir "/tmp/snap.lxd" failed: Permission denied (13)
rsync: opendir "/tmp/systemd-private-689d4be734ea4ba0bed07664111ebfb2-systemd-logind.service-yIc8pf" failed: Permission denied (13)
rsync: opendir "/tmp/systemd-private-689d4be734ea4ba0bed07664111ebfb2-systemd-resolved.service-7dXcSf" failed: Permission denied (13)
rsync: opendir "/tmp/systemd-private-689d4be734ea4ba0bed07664111ebfb2-systemd-timesyncd.service-OP5opf" failed: Permission denied (13)
rsync: [generator] symlink "//fszero/webServerBackup/dailyBackups/MSSCTest1InstanceDaily/etc/systemd/system/multi-user.target.wants/snap-amazon\x2dssm\x2dagent-3552.mount" -> "/etc/systemd/system/snap-amazon\x2dssm\x2dagent-3552.mount" failed: No such file or directory (2)
rsync: [generator] symlink "//fszero/webServerBackup/dailyBackups/MSSCTest1InstanceDaily/etc/systemd/system/multi-user.target.wants/snap-amazon\x2dssm\x2dagent-4046.mount" -> "/etc/systemd/system/snap-amazon\x2dssm\x2dagent-4046.mount" failed: No such file or directory (2)
rsync: [generator] symlink "//fszero/webServerBackup/dailyBackups/MSSCTest1InstanceDaily/run/systemd/units/invocation:snap-amazon\x2dssm\x2dagent-3552.mount" -> "efc6bc3fae7047e8a492313233864ecb" failed: No such file or directory (2)
rsync: [generator] symlink "//fszero/webServerBackup/dailyBackups/MSSCTest1InstanceDaily/run/systemd/units/invocation:snap-amazon\x2dssm\x2dagent-4046.mount" -> "446737710ed54a53b049d6f44d2f58e0" failed: No such file or directory (2)
rsync: send_files failed to open "/etc/ufw/after.init": Permission denied (13)
rsync: send_files failed to open "/etc/ufw/after.rules": Permission denied (13)
rsync: send_files failed to open "/etc/ufw/after6.rules": Permission denied (13)
rsync: send_files failed to open "/etc/ufw/before.init": Permission denied (13)
rsync: send_files failed to open "/etc/ufw/before.rules": Permission denied (13)
rsync: send_files failed to open "/etc/ufw/before6.rules": Permission denied (13)
rsync: send_files failed to open "/etc/ufw/user.rules": Permission denied (13)
rsync: send_files failed to open "/etc/ufw/user6.rules": Permission denied (13)
rsync: send_files failed to open "/home/mssc_ftp/.bash_history": Permission denied (13)
rsync: send_files failed to open "/home/mssc_ftp/.viminfo": Permission denied (13)
rsync: send_files failed to open "/run/agetty.reload": Permission denied (13)
rsync: send_files failed to open "/run/crond.reboot": Permission denied (13)
rsync: send_files failed to open "/run/unattended-upgrades.lock": Permission denied (13)
rsync: send_files failed to open "/run/cloud-init/instance-data-sensitive.json": Permission denied (13)
rsync: send_files failed to open "/run/sendmail/mta/sendmail.pid": Permission denied (13)
rsync: send_files failed to open "/run/snapd/lock/.lock": Permission denied (13)
rsync: send_files failed to open "/run/snapd/lock/lxd.lock": Permission denied (13)
rsync: send_files failed to open "/run/systemd/journal/streams/8:1343715": Permission denied (13)
rsync: send_files failed to open "/run/systemd/journal/streams/8:14809": Permission denied (13)
rsync: send_files failed to open "/run/systemd/journal/streams/8:16464": Permission denied (13)
rsync: send_files failed to open "/run/systemd/journal/streams/8:18030": Permission denied (13)
rsync: send_files failed to open "/run/systemd/journal/streams/8:18750": Permission denied (13)
rsync: send_files failed to open "/run/systemd/journal/streams/8:19654": Permission denied (13)
rsync: send_files failed to open "/run/systemd/journal/streams/8:20320": Permission denied (13)
rsync: send_files failed to open "/run/systemd/journal/streams/8:20422": Permission denied (13)
rsync: send_files failed to open "/run/systemd/journal/streams/8:20439": Permission denied (13)
rsync: send_files failed to open "/run/systemd/journal/streams/8:20441": Permission denied (13) **<--- FINAL LINE INCLUDED IN EMAIL**
rsync: send_files failed to open "/run/systemd/journal/streams/8:21542": Permission denied (13)
rsync: send_files failed to open "/run/systemd/journal/streams/8:21777": Permission denied (13)
rsync: send_files failed to open "/run/systemd/journal/streams/8:21967": Permission denied (13)
rsync: send_files failed to open "/run/systemd/journal/streams/8:22734": Permission denied (13)
rsync: send_files failed to open "/run/systemd/journal/streams/8:24070": Permission denied (13)
rsync: send_files failed to open "/run/systemd/journal/streams/8:27289": Permission denied (13)
rsync: send_files failed to open "/run/systemd/journal/streams/8:3562434": Permission denied (13)
rsync: [receiver] mkstemp "//fszero/webServerBackup/dailyBackups/MSSCTest1InstanceDaily/etc/systemd/system/.snap-amazon\x2dssm\x2dagent-3552.mount.92LXBP" failed: No such file or directory (2)
rsync: [receiver] mkstemp "//fszero/webServerBackup/dailyBackups/MSSCTest1InstanceDaily/etc/systemd/system/.snap-amazon\x2dssm\x2dagent-4046.mount.v3XIgy" failed: No such file or directory (2)
rsync: [generator] recv_generator: mkdir "//fszero/webServerBackup/dailyBackups/MSSCTest1InstanceDaily/run/udev/links/\x2fdisk\x2fby-id\x2fnvme-Amazon_Elastic_Block_Store_vol062363622eca83d85-part1" failed: No such file or directory (2)
*** Skipping any contents from this failed directory ***
rsync: [generator] recv_generator: mkdir "//fszero/webServerBackup/dailyBackups/MSSCTest1InstanceDaily/run/udev/links/\x2fdisk\x2fby-id\x2fnvme-Amazon_Elastic_Block_Store_vol062363622eca83d85" failed: No such file or directory (2)
*** Skipping any contents from this failed directory ***
rsync: [generator] recv_generator: mkdir "//fszero/webServerBackup/dailyBackups/MSSCTest1InstanceDaily/run/udev/links/\x2fdisk\x2fby-id\x2fnvme-nvme.1d0f-766f6c3036323336333632326563613833643835-416d617a6f6e20456c617374696320426c6f636b2053746f7265-00000001-part1" failed: No such file or directory (2)
*** Skipping any contents from this failed directory ***
rsync: [generator] recv_generator: mkdir "//fszero/webServerBackup/dailyBackups/MSSCTest1InstanceDaily/run/udev/links/\x2fdisk\x2fby-id\x2fnvme-nvme.1d0f-766f6c3036323336333632326563613833643835-416d617a6f6e20456c617374696320426c6f636b2053746f7265-00000001" failed: No such file or directory (2)
*** Skipping any contents from this failed directory ***
rsync: [generator] recv_generator: mkdir "//fszero/webServerBackup/dailyBackups/MSSCTest1InstanceDaily/run/udev/links/\x2fdisk\x2fby-label\x2fcloudimg-rootfs" failed: No such file or directory (2)
*** Skipping any contents from this failed directory ***
rsync: [generator] recv_generator: mkdir "//fszero/webServerBackup/dailyBackups/MSSCTest1InstanceDaily/run/udev/links/\x2fdisk\x2fby-partuuid\x2f5198cbc0-01" failed: No such file or directory (2)
*** Skipping any contents from this failed directory ***
rsync: [generator] recv_generator: mkdir "//fszero/webServerBackup/dailyBackups/MSSCTest1InstanceDaily/run/udev/links/\x2fdisk\x2fby-path\x2fpci-0000:00:04.0-nvme-1-part1" failed: No such file or directory (2)
*** Skipping any contents from this failed directory ***
rsync: [generator] recv_generator: mkdir "//fszero/webServerBackup/dailyBackups/MSSCTest1InstanceDaily/run/udev/links/\x2fdisk\x2fby-path\x2fpci-0000:00:04.0-nvme-1" failed: No such file or directory (2)
*** Skipping any contents from this failed directory ***
rsync: [generator] recv_generator: mkdir "//fszero/webServerBackup/dailyBackups/MSSCTest1InstanceDaily/run/udev/links/\x2fdisk\x2fby-uuid\x2fe8070c31-bfee-4314-a151-d1332dc23486" failed: No such file or directory (2)
*** Skipping any contents from this failed directory ***
rsync: [generator] recv_generator: mkdir "//fszero/webServerBackup/dailyBackups/MSSCTest1InstanceDaily/run/udev/links/\x2finput\x2fby-path\x2fplatform-i8042-serio-0-event-kbd" failed: No such file or directory (2)
*** Skipping any contents from this failed directory ***
rsync: [generator] recv_generator: mkdir "//fszero/webServerBackup/dailyBackups/MSSCTest1InstanceDaily/run/udev/links/\x2finput\x2fby-path\x2fplatform-i8042-serio-1-event-mouse" failed: No such file or directory (2)
*** Skipping any contents from this failed directory ***
rsync: [generator] recv_generator: mkdir "//fszero/webServerBackup/dailyBackups/MSSCTest1InstanceDaily/run/udev/links/\x2finput\x2fby-path\x2fplatform-i8042-serio-1-mouse" failed: No such file or directory (2)
*** Skipping any contents from this failed directory ***
rsync: [receiver] mkstemp "//fszero/webServerBackup/dailyBackups/MSSCTest1InstanceDaily/usr/lib/systemd/system/.system-systemd\x2dcryptsetup.slice.XTMqVa" failed: No such file or directory (2)
file has vanished: "//fszero/webServerBackup/dailyBackups/MSSCTest1InstanceDaily/usr/share/perl/5.30.0/pod/Simple/.TranscodeSmart.pm.1u21kZ"
rsync: [receiver] mkstemp "//fszero/webServerBackup/dailyBackups/MSSCTest1InstanceDaily/usr/share/perl/5.30.0/Pod/Text/.Color.pm.BTbXb2" failed: No such file or directory (2)
rsync: [receiver] mkstemp "//fszero/webServerBackup/dailyBackups/MSSCTest1InstanceDaily/usr/share/perl/5.30.0/Pod/Text/.Overstrike.pm.uHx6pP" failed: No such file or directory (2)
rsync: [receiver] mkstemp "//fszero/webServerBackup/dailyBackups/MSSCTest1InstanceDaily/usr/share/perl/5.30.0/Pod/Text/.Termcap.pm.jUsuLK" failed: No such file or directory (2)
cannot delete non-empty directory: usr/share/perl/5.30.0/pod/Simple
rsync: opendir "/var/cache/apparmor/11143a61.0" failed: Permission denied (13)
rsync: opendir "/var/cache/apparmor/26b63962.0" failed: Permission denied (13)
rsync: opendir "/var/cache/apparmor/e3a82466.0" failed: Permission denied (13)
rsync: opendir "/var/cache/apt/archives/partial" failed: Permission denied (13)
rsync: opendir "/var/cache/ldconfig" failed: Permission denied (13)
rsync: opendir "/var/cache/pollinate" failed: Permission denied (13)
rsync: opendir "/var/cache/private" failed: Permission denied (13)
rsync: opendir "/var/lib/AccountsService/users" failed: Permission denied (13)
rsync: opendir "/var/lib/amazon" failed: Permission denied (13)
rsync: opendir "/var/lib/apt/lists/partial" failed: Permission denied (13)
rsync: send_files failed to open "/var/cache/apt/archives/lock": Permission denied (13)
rsync: send_files failed to open "/var/cache/debconf/passwords.dat": Permission denied (13)
rsync: send_files failed to open "/var/lib/apt/lists/lock": Permission denied (13)
rsync: send_files failed to open "/var/lib/cloud/instances/i-0d81ad768f77d90b8/cloud-config.txt": Permission denied (13)
rsync: send_files failed to open "/var/lib/cloud/instances/i-0d81ad768f77d90b8/obj.pkl": Permission denied (13)
rsync: send_files failed to open "/var/lib/cloud/instances/i-0d81ad768f77d90b8/user-data.txt": Permission denied (13)
rsync: send_files failed to open "/var/lib/cloud/instances/i-0d81ad768f77d90b8/user-data.txt.i": Permission denied (13)
rsync: send_files failed to open "/var/lib/cloud/instances/i-0d81ad768f77d90b8/vendor-data.txt": Permission denied (13)
rsync: send_files failed to open "/var/lib/cloud/instances/i-0d81ad768f77d90b8/vendor-data.txt.i": Permission denied (13)
rsync: send_files failed to open "/var/lib/cloud/instances/i-0d81ad768f77d90b8/vendor-data2.txt": Permission denied (13)
rsync: send_files failed to open "/var/lib/cloud/instances/i-0d81ad768f77d90b8/vendor-data2.txt.i": Permission denied (13)
rsync: send_files failed to open "/var/lib/dpkg/lock": Permission denied (13)
rsync: send_files failed to open "/var/lib/dpkg/lock-frontend": Permission denied (13)
rsync: opendir "/var/lib/fwupd/gnupg" failed: Permission denied (13)
rsync: opendir "/var/lib/nginx/body" failed: Permission denied (13)
rsync: opendir "/var/lib/nginx/fastcgi" failed: Permission denied (13)
rsync: opendir "/var/lib/nginx/proxy" failed: Permission denied (13)
rsync: opendir "/var/lib/nginx/scgi" failed: Permission denied (13)
rsync: opendir "/var/lib/nginx/uwsgi" failed: Permission denied (13)
rsync: opendir "/var/lib/php/sessions" failed: Permission denied (13)
rsync: opendir "/var/lib/polkit-1" failed: Permission denied (13)
rsync: opendir "/var/lib/private" failed: Permission denied (13)
rsync: opendir "/var/lib/sendmail" failed: Permission denied (13)
rsync: opendir "/var/lib/snapd/cache" failed: Permission denied (13)
rsync: opendir "/var/lib/snapd/cookie" failed: Permission denied (13)
rsync: opendir "/var/lib/snapd/void" failed: Permission denied (13)
rsync: opendir "/var/lib/update-notifier/package-data-downloads/partial" failed: Permission denied (13)
rsync: opendir "/var/log/amazon" failed: Permission denied (13)
rsync: opendir "/var/log/private" failed: Permission denied (13)
rsync: opendir "/var/snap/lxd/common/lxd" failed: Permission denied (13)
rsync: opendir "/var/spool/cron/atjobs" failed: Permission denied (13)
rsync: opendir "/var/spool/cron/atspool" failed: Permission denied (13)
rsync: opendir "/var/spool/cron/crontabs" failed: Permission denied (13)
rsync: opendir "/var/spool/mqueue-client" failed: Permission denied (13)
rsync: opendir "/var/spool/mqueue" failed: Permission denied (13)
rsync: opendir "/var/spool/rsyslog" failed: Permission denied (13)
rsync: opendir "/var/tmp/systemd-private-689d4be734ea4ba0bed07664111ebfb2-systemd-logind.service-YcEckh" failed: Permission denied (13)
rsync: opendir "/var/tmp/systemd-private-689d4be734ea4ba0bed07664111ebfb2-systemd-resolved.service-5eAPVi" failed: Permission denied (13)
rsync: opendir "/var/tmp/systemd-private-689d4be734ea4ba0bed07664111ebfb2-systemd-timesyncd.service-uelrmg" failed: Permission denied (13)
rsync: send_files failed to open "/var/lib/dpkg/triggers/Lock": Permission denied (13)
rsync: send_files failed to open "/var/lib/fwupd/pki/secret.key": Permission denied (13)
rsync: send_files failed to open "/var/lib/snapd/state.json": Permission denied (13)
rsync: send_files failed to open "/var/lib/snapd/device/private-keys-v1/tGuSwqQ0IOxQ18J3Favo7oMpll4QagrjwWWCzz1KvjeBG8rgbgnq6NCPpAVn6QVp": Permission denied (13)
rsync: send_files failed to open "/var/lib/snapd/seed/snaps/amazon-ssm-agent_3552.snap": Permission denied (13)
rsync: send_files failed to open "/var/lib/snapd/seed/snaps/core18_1997.snap": Permission denied (13)
rsync: send_files failed to open "/var/lib/snapd/seed/snaps/lxd_19647.snap": Permission denied (13)
rsync: send_files failed to open "/var/lib/snapd/seed/snaps/snapd_11588.snap": Permission denied (13)
rsync: send_files failed to open "/var/lib/snapd/snaps/amazon-ssm-agent_3552.snap": Permission denied (13)
rsync: send_files failed to open "/var/lib/snapd/snaps/amazon-ssm-agent_4046.snap": Permission denied (13)
rsync: send_files failed to open "/var/lib/snapd/snaps/core18_2246.snap": Permission denied (13)
rsync: send_files failed to open "/var/lib/snapd/snaps/core18_2253.snap": Permission denied (13)
rsync: send_files failed to open "/var/lib/snapd/snaps/core20_1242.snap": Permission denied (13)
rsync: send_files failed to open "/var/lib/snapd/snaps/core20_1270.snap": Permission denied (13)
rsync: send_files failed to open "/var/lib/snapd/snaps/lxd_21803.snap": Permission denied (13)
rsync: send_files failed to open "/var/lib/snapd/snaps/lxd_21835.snap": Permission denied (13)
rsync: send_files failed to open "/var/lib/snapd/snaps/snapd_14066.snap": Permission denied (13)
rsync: send_files failed to open "/var/lib/snapd/snaps/snapd_14295.snap": Permission denied (13)
rsync: send_files failed to open "/var/lib/systemd/random-seed": Permission denied (13)
rsync: send_files failed to open "/var/lib/update-notifier/hwe-eol": Permission denied (13)
rsync: send_files failed to open "/var/log/btmp": Permission denied (13)
rsync: send_files failed to open "/var/log/btmp.1": Permission denied (13)
rsync: send_files failed to open "/var/log/php7.4-fpm.log": Permission denied (13)
rsync: send_files failed to open "/var/log/php7.4-fpm.log.1": Permission denied (13)
rsync: send_files failed to open "/var/log/php7.4-fpm.log.2.gz": Permission denied (13)
rsync: send_files failed to open "/var/log/php7.4-fpm.log.3.gz": Permission denied (13)
rsync: send_files failed to open "/var/log/php7.4-fpm.log.4.gz": Permission denied (13)
rsync: send_files failed to open "/var/log/php7.4-fpm.log.5.gz": Permission denied (13)
rsync: send_files failed to open "/var/log/php7.4-fpm.log.6.gz": Permission denied (13)
rsync: send_files failed to open "/var/log/php7.4-fpm.log.7.gz": Permission denied (13)
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1816) [generator=3.2.3]
/usr/bin/tar: Removing leading "//" from member names
/usr/bin/tar: //fszero/webServerBackup/dailyBackups/MSSCTest1InstanceDaily/run/acpid.socket: socket ignored
/usr/bin/tar: //fszero/webServerBackup/dailyBackups/MSSCTest1InstanceDaily/run/snapd-snap.socket: socket ignored
/usr/bin/tar: //fszero/webServerBackup/dailyBackups/MSSCTest1InstanceDaily/run/snapd.socket: socket ignored
/usr/bin/tar: //fszero/webServerBackup/dailyBackups/MSSCTest1InstanceDaily/run/dbus/system_bus_socket: socket ignored
/usr/bin/tar: //fszero/webServerBackup/dailyBackups/MSSCTest1InstanceDaily/run/irqbalance/irqbalance474.sock: socket ignored
/usr/bin/tar: //fszero/webServerBackup/dailyBackups/MSSCTest1InstanceDaily/run/php/php7.4-fpm.sock: socket ignored
/usr/bin/tar: //fszero/webServerBackup/dailyBackups/MSSCTest1InstanceDaily/run/sendmail/mta/smcontrol: socket ignored
/usr/bin/tar: //fszero/webServerBackup/dailyBackups/MSSCTest1InstanceDaily/run/systemd/fsck.progress: socket ignored
/usr/bin/tar: //fszero/webServerBackup/dailyBackups/MSSCTest1InstanceDaily/run/systemd/notify: socket ignored
/usr/bin/tar: //fszero/webServerBackup/dailyBackups/MSSCTest1InstanceDaily/run/systemd/private: socket ignored
/usr/bin/tar: //fszero/webServerBackup/dailyBackups/MSSCTest1InstanceDaily/run/systemd/journal/dev-log: socket ignored
/usr/bin/tar: //fszero/webServerBackup/dailyBackups/MSSCTest1InstanceDaily/run/systemd/journal/io.systemd.journal: socket ignored
/usr/bin/tar: //fszero/webServerBackup/dailyBackups/MSSCTest1InstanceDaily/run/systemd/journal/socket: socket ignored
/usr/bin/tar: //fszero/webServerBackup/dailyBackups/MSSCTest1InstanceDaily/run/systemd/journal/stdout: socket ignored
/usr/bin/tar: //fszero/webServerBackup/dailyBackups/MSSCTest1InstanceDaily/run/systemd/journal/syslog: socket ignored
/usr/bin/tar: //fszero/webServerBackup/dailyBackups/MSSCTest1InstanceDaily/run/systemd/userdb/io.systemd.DynamicUser: socket ignored
/usr/bin/tar: //fszero/webServerBackup/dailyBackups/MSSCTest1InstanceDaily/run/udev/control: socket ignored
/usr/bin/tar: //fszero/webServerBackup/dailyBackups/MSSCTest1InstanceDaily/run/user/1000/bus: socket ignored
/usr/bin/tar: //fszero/webServerBackup/dailyBackups/MSSCTest1InstanceDaily/run/user/1000/pk-debconf-socket: socket ignored
/usr/bin/tar: //fszero/webServerBackup/dailyBackups/MSSCTest1InstanceDaily/run/user/1000/snapd-session-agent.socket: socket ignored
/usr/bin/tar: //fszero/webServerBackup/dailyBackups/MSSCTest1InstanceDaily/run/user/1000/gnupg/S.dirmngr: socket ignored
/usr/bin/tar: //fszero/webServerBackup/dailyBackups/MSSCTest1InstanceDaily/run/user/1000/gnupg/S.gpg-agent: socket ignored
/usr/bin/tar: //fszero/webServerBackup/dailyBackups/MSSCTest1InstanceDaily/run/user/1000/gnupg/S.gpg-agent.browser: socket ignored
/usr/bin/tar: //fszero/webServerBackup/dailyBackups/MSSCTest1InstanceDaily/run/user/1000/gnupg/S.gpg-agent.extra: socket ignored
/usr/bin/tar: //fszero/webServerBackup/dailyBackups/MSSCTest1InstanceDaily/run/user/1000/gnupg/S.gpg-agent.ssh: socket ignored
/usr/bin/tar: //fszero/webServerBackup/dailyBackups/MSSCTest1InstanceDaily/run/user/1000/systemd/notify: socket ignored
/usr/bin/tar: //fszero/webServerBackup/dailyBackups/MSSCTest1InstanceDaily/run/user/1000/systemd/private: socket ignored
/usr/bin/tar: //fszero/webServerBackup/dailyBackups/MSSCTest1InstanceDaily/run/uuidd/request: socket ignored
cn flag
Why are you appending a line break and sending a plain text log as html?
br flag
have you confirmed that the info you are sending to the email command contains all the expected info?
Neil Wehneman avatar
in flag
@GregAskew The email functionality I found in my Googling used HTML, and inserting `<BR>` got me up and running faster than debugging why `\n` and the like weren't working. As to why I'm not just emailing the log file itself, I want to get the contents of the log file into a body (rather than attaching it) as reading from the body vs. opening an attachment will save me time on reviewing these on a daily basis when I have a few dozen of them.
Neil Wehneman avatar
in flag
@Lee_Daily That's a good point. I will look into that now.
cn flag
If html is specified and the text does not conform to html that could explain it. If it works sending as text that would be an easy test.
Neil Wehneman avatar
in flag
@Lee_Dailey I've updated the question with the information that the `output` variable is itself truncated, so the problem is likely arising with how that variable is populated.
br flag
@NeilWehneman - i would replace your 1st script with powershell code if at all possible. that would let you take advantage of folks who have PoSh expertise, but not BAT/CMD expertise.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.