email after job done

15 posts / 0 new
Last post
itefix
Offline
Last seen: 5 hours 11 min ago
Joined: 01.05.2008 - 21:33
email after job done

Hi there,

I was wondering if somebody has an idea how to initiate an email on the Windows XP after the rsync job is done. Under Unix this is quite easy, but honestly I have no clue how to do this from a DOS command line.

Any hints are greatly appreciated.

 

Thanks

mr

itefix
Offline
Last seen: 5 hours 11 min ago
Joined: 01.05.2008 - 21:33
Re: email after job done

Blat can do the job.

itefix
Offline
Last seen: 5 hours 11 min ago
Joined: 01.05.2008 - 21:33
Re: email after job done

I was wondering if somebody has an idea how to initiate an email on the Windows XP...

POSTIE is another option, as well as countless Perl modules.

 -Tom

itefix
Offline
Last seen: 5 hours 11 min ago
Joined: 01.05.2008 - 21:33
Re: email after job done

Thanks a lot for the tips. I used postie which worked great. I now try to get the result of the rsync into a file. I'm running XP and tried:
rsync -e "%CWRSYNCHOME%\bin\ssh " -atzv --modify-window=1 1>backup.txt
rsync -e "%CWRSYNCHOME%\bin\ssh " -atzv --modify-window=1 > backup.txt
rsync -e "%CWRSYNCHOME%\bin\ssh " -atzv --modify-window=1 >> backup.txt

but all of them just create an empy file. Any hints?

Thanks

itefix
Offline
Last seen: 5 hours 11 min ago
Joined: 01.05.2008 - 21:33
Re: email after job done

Your rsync commands don't have source or destination. Please check rsync documentation for options.

itefix
Offline
Last seen: 5 hours 11 min ago
Joined: 01.05.2008 - 21:33
Re: email after job done

Hello,
I use rsync to copy file from an XP Computer to a W2003 Server through a SSH tunnel.

It works nice.

I add two new exe to my bin folder : dt.exe to get date
and blat.exe to send email when the job is done.

But I can't send the stats by email.

that's my batch file :

@ECHO OFF
DEL c:\resume.log
cd C:\Program Files\cwRsync\bin
echo ******************************** >> c:\resume.log
dt >> c:\resume.log

SET SECHAW_IDENTITY="C:\Program Files\cwRsync\cwrsync.txt"
SET SECHAW_TYPE=ssh
SET SECHAW_LOCALPORT=9119
SET SECHAW_SERVER=Server IP
SET SECHAW_SERVERPORT=873
SET SECHAW_USER=SvcwRsync
SET SECHAW_CMD="C:\Program Files\cwRsync\bin\rsync.exe" -rvu --stats /cygdrive/e/work/

rsync://SvcwRsync@localhost:9119/david

SET SECHAW_TUNNEL=ssh -i "C:\Program Files\cwRsync\cwrsync.txt" -L 9119:127.0.0.1:873

SvcwRsync@Server IP -T -N
"C:\Program Files\cwRsync\bin\sechaw.exe" --verbose

echo ******************************** >> c:\resume.log

cd C:\Program Files\cwRsync\bin

blat c:\resume.log -to david@mycompany.com

and actually I receive something like that :

********************************
Sun Nov 13 19:11:33 2005
********************************

Could you explain me how to solve this ?

Regards,

David

itefix
Offline
Last seen: 5 hours 11 min ago
Joined: 01.05.2008 - 21:33
Re: email after job done

This works fine, but don't use a SSH Tunnel.So I think the problem is in the SECHAW syntax.

@ECHO OFF
SET CWRSYNCHOME=C:\PROGRAM FILES\CWRSYNC
SET CYGWIN=nontsec
SET HOME=%HOMEDRIVE%%HOMEPATH%
SET CWOLDPATH=%PATH%
SET PATH=%CWRSYNCHOME%\BIN;%PATH%

rsync -r --stats /cygdrive/e/work/ Server_ip::david/ >c:\resume.log

cd C:\Program Files\cwRsync\bin
blat c:\resume.log -to david@mycompany

itefix
Offline
Last seen: 5 hours 11 min ago
Joined: 01.05.2008 - 21:33
Re: email after job done

Hello,

I use rsync to copy file from an XP Computer to a W2003 Server through a SSH tunnel.

.....
"C:\Program Files\cwRsync\bin\sechaw.exe" --verbose

.....

Try to redirect the output from sechaw itself:

"C:\Program Files\cwRsync\bin\sechaw.exe" --verbose
>> c:\resume.log

itefix
Offline
Last seen: 5 hours 11 min ago
Joined: 01.05.2008 - 21:33
Re: email after job done

@ECHO OFFDEL c:\resume.log
cd C:\Program Files\cwRsync\bin
echo ******************************** >> c:\resume.log
dt >> c:\resume.log

SET SECHAW_IDENTITY="C:\Program Files\cwRsync\cwrsync.txt"
SET SECHAW_TYPE=ssh
SET SECHAW_LOCALPORT=9119
SET SECHAW_SERVER=Server IP
SET SECHAW_SERVERPORT=873
SET SECHAW_USER=SvcwRsync
SET SECHAW_CMD="C:\Program Files\cwRsync\bin\rsync.exe" -rvu --stats /cygdrive/e/work/

rsync://SvcwRsync@localhost:9119/david

SET SECHAW_TUNNEL=ssh -i "C:\Program Files\cwRsync\cwrsync.txt" -L 9119:127.0.0.1:873

SvcwRsync@Server IP -T -N
"C:\Program Files\cwRsync\bin\sechaw.exe" --verbose >> c:\resume.log

echo ******************************** >> c:\resume.log

cd C:\Program Files\cwRsync\bin

blat c:\resume.log -to david@mycompany.com
______________________________________

This generate a resume.log file but the script stop

Le processus ne peut pas accéder au fichier car ce fichier est utilisé par un autre process
us.
error reading c:\resume.log, aborting
Appuyez sur une touche pour continuer...

So it seems that the log is still open.
Open can I close it before sending ?

itefix
Offline
Last seen: 5 hours 11 min ago
Joined: 01.05.2008 - 21:33
Re: email after job done

Try to start sechaw with start /wait.

itefix
Offline
Last seen: 5 hours 11 min ago
Joined: 01.05.2008 - 21:33
Re: email after job done

How do I use start /wait ?thanks.

itefix
Offline
Last seen: 5 hours 11 min ago
Joined: 01.05.2008 - 21:33
Re: email after job done

:-) Finaly, don't change anything.Just use the last version of blat.exe

blat project Here

dfirth
Offline
Last seen: 12 years 10 months ago
Joined: 01.05.2008 - 21:33
Re: email after job done

Any tips on how to add the time taken for the backup process to complete. Can the sechaw command ouput the time taken to the log file?

I could of course write the time to the sechaw logfile immediately after the process has finished (and before emailing), but how do I get teh starting time in?

Many thanks

itefix
Offline
Last seen: 5 hours 11 min ago
Joined: 01.05.2008 - 21:33
Re: email after job done

You can update rsync command with --stats option.

dfirth
Offline
Last seen: 12 years 10 months ago
Joined: 01.05.2008 - 21:33
Re: email after job done

I am using --stats but it does not contain the time taken info. Can I fix this?

Thanks

Denys

Topic locked

Release news