Enviado em 08/01/2021 - 10:48h
Bom dia, Boa tarde, Boa noite!!#!/bin/bash
linha="|--------------------------------------------|";
LOG="./reg-log.txt";
printf "${linha}\n Sincronização iniciada: %(%x-%X)T\n${linha}\n" >> $LOG
# -r => Recursively copy entire directories.
for Dirs in CHP{E,I,G};do
find $Dirs -mtime -1 -print
# scp -r "/home/saai/${Dirs}/" Teste@IP:/home/Teste/Config/TEMP/
rsync --update -bt "/home/saai/${Dirs}/" saai@IP:/home/Teste/Config/TEMP/
done
printf "${linha}\n Sincronização finalizada: %(%x-%X)T\n${linha}\n" >> $LOG
find: ‘CHPE’: No such file or directory
skipping directory .
rsync: ERROR: cannot stat destination "/home/Teste/Config/TEMP/": Permission denied (13)
rsync error: errors selecting input/output files, dirs (code 3) at main.c(635) [Receiver=3.1.2]
find: ‘CHPI’: No such file or directory
skipping directory .
rsync: ERROR: cannot stat destination "/home/Teste/Config/TEMP/": Permission denied (13)
rsync error: errors selecting input/output files, dirs (code 3) at main.c(635) [Receiver=3.1.2]
find: ‘CHPG’: No such file or directory
skipping directory .
rsync: ERROR: cannot stat destination "/home/Teste/Config/TEMP/": Permission denied (13)
rsync error: errors selecting input/output files, dirs (code 3) at main.c(635) [Receiver=3.1.2]
You have new mail in /var/spool/mail/saai