-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSIAFREE
More file actions
21 lines (18 loc) · 803 Bytes
/
Copy pathSIAFREE
File metadata and controls
21 lines (18 loc) · 803 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/bash
#LOGFILE="/var/log/${0##*/}".log
#Habilita o log copiando a saida padrão para o arquivo LOGFILE
#exec 1> >(tee -a "$LOGFILE")
#Faz o mesmo para a saÃda de ERROS
#exec 2>&1
# A linha abaixo so deve ser descomentada para Debug do Script
#set -x
data_dn=`date +%d%m%g`
#ENTRAR NO DIRETORIO AONDE ESTÃO OS ARQUIVOS BAIXADOS PELO WGET
#Criei a pasta SINCRO_PRIV pois lá vai ser o repo dos arquivos do sia
cd /home/user/SINCRO_PRIV/
## Lembrando que nessa parte ele sincroniza os arquivos diários por data
wget -S -N -r ftp://USER:PASSWD@dcs1.volkswagen.com.br:990/RECEIVE/*
#Essa parte é importante cuidar a hora de execução do script pois o sia libera
#...o arquivo as 6:30 coloquei executar att as 8h
find . -mtime 0 -exec cp "{}" /path/da/pasta/${data_dn} \;
##EOF