On 11/2/07, John Weller wrote: > I'm trying to use a batch file to mirror data across a network. The network > is a peer-to-peer using a workgroup, not a domain. The batch file is set > off as a cron job using PyCron which is installed as a service. The batch > file command is: > > ECHO A | XCOPY D:\MyFolder\*.* W:\Backup\MyFolder\ /s /e /v > > where W: is a mapped drive on the network. > > It works like a charm when I run it but when it is triggered by PyCron it > fails claiming that the drive spec is not valid. I tried replacing the > letters with the UNC code but no joy. I have a VFP program which can do a > similar job but the XCOPY command is much simpler and more flexible so I > would prefer to use that. > > Any suggestions gratefully received! > > John Weller > 01380 723235 > 07976 393631
Hi John, Is the entry in crontab.txt calling a batch file, or are you making the "ECHO A | XCOPY ..." statement directly? I've used pycron for over 6 months and find it works best if it calls a batch file, which has as its' first line, a cd command to whatever working directory the remaining batch commands require. For example: crontab.txt: 30 12 1 11 * "c:\windows\system32\cmd.exe" /c "C:\python25\betting\2007-11\2007-11-01\2007-11-01 1300 Newc 2m Nov Hrd\20668886-bettting.bat" 40 12 1 11 * "c:\windows\system32\cmd.exe" /c "C:\python25\betting\2007-11\2007-11-01\2007-11-01 1310 Ling 7f Mdn Stks\20668490-bettting.bat" etc. and the batch files look like this: 20668886-bettting.bat: cd "C:\PYTHON25\BETTING\2007-11\2007-11-01\2007-11-01 1300 Newc 2m Nov Hrd" copy ..\Raccoon.exe . Start /MIN Raccoon.exe 20668886 exit Cheers, Garry _______________________________________________ Post Messages to: [email protected] Subscription Maintenance: http://leafe.com/mailman/listinfo/profox OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/[EMAIL PROTECTED] ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

