Sistemas‎ > ‎Linux‎ > ‎Scripts Linux‎ > ‎Cópia entre servidores‎ > ‎

copiaArquivoDeLinuxParaWindows.sh

#!/bin/bash

mount -t cifs -o username=administrador,password=123456 //192.168.2.4/c$/temp /mnt/temp/

cp /root/saida/*.txt /mnt/temp/entrada
mv /mnt/temp/saida/BAL* /root/entrada

agora=$(date +"%Y%m%d-%H%M")
tar cvfz /empresa/backup/$agora.tar.gz /root/saida /root/entrada
rm -rf /root/saida/*.txt
find /empresa/backup/ -mtime +30 -exec rm -rf {} \;

umount /mnt/temp/

Comments