Hello my friends,
I'm configuring an rsync between 2 machines, A_Server --> B_Server, using the following script:
Quote:
#!/bin/bash
#
# Script de backup a través de Rsync desde RMP-1 hasta RMP-2.
#
# Si se produce algún error en cualquier momento abortar.
#set -e
DATOS="/tmp/prueba.txt"
EXCLUDES=
OPTS="-vv --relative --delete --force --ignore-errors --delete-excluded --exclude-from=$EXCLUDES -a"
RSERVER="rsync://A_Server@192.168.1.4/A_Server/"
export RSYNC_PASSWORD=1234
#Este script sincroniza los datos de Asterisk de RMP-1 a RMP-2 a través
#del servicio rsyncd. Los datos se guardan en RMP-2 en la carpeta
#/home/RMP-1/.
"
echo
echo "Copiando datos ..."
echo "rsync $OPTS $DATOS $RSERVER"
rsync $OPTS $DATOS $RSERVER
echo "OK"
echo
echo "Hora Fin: $(date)"
echo "=)"
|
The Rsyn is working OK. What i need is to change one of the lines of the /tmp/prueba.txt before sending it to the remote machine (obviously not changing the file in the local machine), i mean, send prueba.txt to the remote machine deleting one line and adding another one...how can i do this????
sed is a good choice, but no clue how to put all together in the same script...i would appreciate your help
BEST REGARDS!!!