diff options
Diffstat (limited to 'BUILD/Help/html/Batch Scripting.html')
-rw-r--r-- | BUILD/Help/html/Batch Scripting.html | 112 |
1 files changed, 47 insertions, 65 deletions
diff --git a/BUILD/Help/html/Batch Scripting.html b/BUILD/Help/html/Batch Scripting.html index 5ecddba7..526d3d79 100644 --- a/BUILD/Help/html/Batch Scripting.html +++ b/BUILD/Help/html/Batch Scripting.html @@ -5,7 +5,7 @@ <TITLE></TITLE> <META NAME="GENERATOR" CONTENT="OpenOffice.org 3.2 (Win32)"> <META NAME="CREATED" CONTENT="20091206;16574000"> - <META NAME="CHANGED" CONTENT="20111019;20535600"> + <META NAME="CHANGED" CONTENT="20120511;23115700"> <META NAME="Info 1" CONTENT=""> <META NAME="Info 2" CONTENT=""> <META NAME="Info 3" CONTENT=""> @@ -14,92 +14,74 @@ <!-- @page { margin: 2cm } P { margin-bottom: 0.21cm } - H3 { margin-bottom: 0.21cm } - H3.western { font-family: "Arial", sans-serif } - H3.cjk { font-family: "MS Mincho" } - H3.ctl { font-family: "Mangal" } + H2.cjk { font-family: "SimSun" } + H2.ctl { font-family: "Mangal" } A:link { so-language: zxx } --> </STYLE> </HEAD> <BODY LANG="en-US" DIR="LTR"> -<H3 CLASS="western"><FONT FACE="Tahoma, sans-serif">Batch Scripting -<SPAN STYLE="font-weight: normal">(Windows)</SPAN></FONT></H3> +<H2 CLASS="western"><FONT FACE="Tahoma, sans-serif"><FONT SIZE=4 STYLE="font-size: 15pt">Batch +Scripting</FONT></FONT></H2> <P STYLE="margin-bottom: 0cm"><BR> </P> -<P STYLE="margin-bottom: 0cm"><FONT FACE="Tahoma, sans-serif">In -order to facilitate using FreeFileSync and RealtimeSync in advanced -synchronization scenarios, creating batch files is a good way to -provide additional functionality. The following section will give -some general hints and examples for custom *.cmd and *.bat files.</FONT></P> +<P STYLE="margin-bottom: 0cm"><FONT FACE="Tahoma, sans-serif">FreeFileSync +can be called from command line and supports integration into batch +scripts. This section gives some general hints and examples for +Windows *.cmd and *.bat scripts.</FONT></P> <P STYLE="margin-bottom: 0cm"><BR> </P> -<UL> - <LI><P STYLE="margin-bottom: 0cm"><FONT FACE="Tahoma, sans-serif">When - starting a batch file from RealtimeSync make synchronous calls to - FreeFileSync only. This will prevent RealtimeSync continue detecting - changes while synchronization is still in progress.<BR> </FONT></P> - <LI><P STYLE="margin-bottom: 0cm"><FONT FACE="Tahoma, sans-serif">During - execution of a Windows Batch file (*.bat/*.cmd) a black console - window is shown. You can hide it using the Visual Basic script - "RunSilent.vbs" located in FreeFileSync's installation - directory.</FONT></P> -</UL> -<OL> - <P STYLE="margin-bottom: 0cm"><FONT FACE="Tahoma, sans-serif"><B>Usage:</B></FONT></P> -</OL> -<P STYLE="margin-left: 1.32cm; margin-bottom: 0cm"><SPAN ID="Rahmen1" DIR="LTR" STYLE="float: left; width: 80%; height: 0.14cm; border: none; padding: 0cm; background: #e6e6e6"> - <P ALIGN=LEFT STYLE="margin-left: 0.79cm; margin-right: 0.98cm; margin-bottom: 0cm"> - <FONT FACE="Courier New, monospace">wscript C:\Program - files\FreeFileSync\Invisible.vbs C:\MyBatchFile.cmd</FONT></P> +<P STYLE="margin-bottom: 0cm"><FONT FACE="Tahoma, sans-serif">When +FreeFileSync is started in batch mode (a *.ffs_batch file is passed +as argument) it returns one of the following status codes:</FONT></P> +<P STYLE="margin-left: 1.46cm; margin-bottom: 0cm"><SPAN ID="Rahmen1" DIR="LTR" STYLE="float: left; width: 80%; height: 0.14cm; border: 1px solid #000080; padding: 0.05cm; background: #ccccff"> + <UL> + <P ALIGN=LEFT STYLE="margin-right: 0.98cm; margin-bottom: 0cm"><FONT FACE="Tahoma, sans-serif"><SPAN STYLE="font-style: normal"><B>Return + Codes</B></SPAN><SPAN STYLE="font-style: normal"><BR>0 - + Synchronization completed successfully<BR>1 - Synchronization + completed with errors<BR>2 - Synchronization was aborted</SPAN></FONT></P> + </UL> </SPAN><BR CLEAR=LEFT><BR> </P> -<UL> - <LI><P STYLE="margin-bottom: 0cm"><FONT FACE="Tahoma, sans-serif">FreeFileSync - returns with an Errorlevel below zero if unresolved problems remain:</FONT></P> -</UL> -<P STYLE="margin-left: 1.32cm; margin-bottom: 0cm"><SPAN ID="Rahmen2" DIR="LTR" STYLE="float: left; width: 80%; height: 0.14cm; border: none; padding: 0cm; background: #e6e6e6"> +<P STYLE="margin-bottom: 0cm; font-weight: normal"><FONT FACE="Tahoma, sans-serif">Now +you can check if synchronization was successful from a script:</FONT></P> +<P STYLE="margin-left: 1.32cm; margin-bottom: 0cm"><SPAN ID="Rahmen6" DIR="LTR" STYLE="float: left; width: 80%; height: 0.14cm; border: none; padding: 0cm; background: #e6e6e6"> <P ALIGN=LEFT STYLE="margin-left: 0.79cm; margin-right: 0.98cm; margin-bottom: 0cm"> <FONT FACE="Tahoma, sans-serif"><FONT FACE="Courier New, monospace">"C:\Program - Files\FreeFileSync\FreeFileSync.exe" - "H:\Silent_Config.ffs_batch"<BR>if not errorlevel 0 - (<BR> </FONT><FONT COLOR="#808080"><FONT FACE="Courier New, monospace"><I><B>::if - something went wrong, add special treatment here<BR> </B></I></FONT></FONT><FONT COLOR="#000000"><FONT FACE="Courier New, monospace"><SPAN STYLE="font-style: normal"><SPAN STYLE="font-weight: normal">echo + Files\FreeFileSync\FreeFileSync.exe" "H:\some + folder\SyncJob.ffs_batch"<BR>if errorlevel 1 (<BR> </FONT><FONT COLOR="#808080"><FONT FACE="Courier New, monospace"><I><B>::if + return code is 1 or greater, something went wrong, add special + treatment here<BR> </B></I></FONT></FONT><FONT COLOR="#000000"><FONT FACE="Courier New, monospace"><SPAN STYLE="font-style: normal"><SPAN STYLE="font-weight: normal">echo Errors occurred during synchronization...</SPAN></SPAN></FONT></FONT><FONT COLOR="#808080"><FONT FACE="Courier New, monospace"><I><B><BR> </B></I></FONT></FONT><FONT FACE="Courier New, monospace">pause<BR>)</FONT></FONT></P> </SPAN><BR CLEAR=LEFT><BR> </P> +<P STYLE="margin-left: 1.32cm; margin-bottom: 0cm"><FONT FACE="Tahoma, sans-serif">Instead +of displaying "An error occurred!" you can also send an +email notification (using a third party tool).</FONT> +</P> <P STYLE="margin-bottom: 0cm"><BR> </P> -<P STYLE="margin-bottom: 0cm"><FONT FACE="Tahoma, sans-serif"><B>Example:</B> -Shutdown PC after synchronization</FONT></P> -<P STYLE="margin-left: 1.32cm; margin-bottom: 0cm"><SPAN ID="Rahmen4" DIR="LTR" STYLE="float: left; width: 80%; height: 0.14cm; border: none; padding: 0cm; background: #e6e6e6"> +<P STYLE="margin-left: 1.46cm; margin-bottom: 0cm"><SPAN ID="Rahmen3" DIR="LTR" STYLE="float: left; width: 80%; height: 0.14cm; border: 1px solid #000080; padding: 0.05cm; background: #ccccff"> <P ALIGN=LEFT STYLE="margin-left: 0.79cm; margin-right: 0.98cm; margin-bottom: 0cm"> - <FONT COLOR="#808080"><FONT FACE="Courier New, monospace"><I><B>::start - FreeFileSync Batch - Job<BR></B></I></FONT></FONT><FONT FACE="Courier New, monospace">"C:\Users\ZenJu\Desktop\SyncJob.ffs_batch"<BR> </FONT><FONT COLOR="#808080"><FONT FACE="Courier New, monospace"><I><B>::schedule - shutdown after 10 seconds<BR></B></I></FONT></FONT><FONT FACE="Courier New, monospace">shutdown - /s /t 10</FONT></P> + <FONT FACE="Tahoma, sans-serif"><B>Attention<BR></B>Make sure your + script is not blocked by a popup dialog. Consider the following + options when setting up a FreeFileSync batch job:</FONT></P> + <UL> + <LI><P ALIGN=LEFT STYLE="margin-bottom: 0cm"><FONT FACE="Tahoma, sans-serif">Disable + checkbox "<I>Show progress dialog</I>" or have "On + completion" automatically close the results dialog after + synchronization.</FONT></P> + <LI><P ALIGN=LEFT STYLE="margin-bottom: 0cm"><FONT FACE="Tahoma, sans-serif"><SPAN STYLE="font-weight: normal">Set + "</SPAN></FONT><FONT FACE="Tahoma, sans-serif"><I><SPAN STYLE="font-weight: normal">Error + handling</SPAN></I></FONT><FONT FACE="Tahoma, sans-serif"><SPAN STYLE="font-weight: normal">" + to "</SPAN></FONT><FONT FACE="Tahoma, sans-serif"><I><SPAN STYLE="font-weight: normal">Exit + instantly</SPAN></I></FONT><FONT FACE="Tahoma, sans-serif"><SPAN STYLE="font-weight: normal">" + or "</SPAN></FONT><FONT FACE="Tahoma, sans-serif"><I><SPAN STYLE="font-weight: normal">Ignore + errors</SPAN></I></FONT><FONT FACE="Tahoma, sans-serif"><SPAN STYLE="font-weight: normal">".</SPAN></FONT></P> + </UL> </SPAN><BR CLEAR=LEFT><BR> </P> <P STYLE="margin-bottom: 0cm"><BR> </P> -<P STYLE="margin-bottom: 0cm"><FONT FACE="Tahoma, sans-serif"><B>Example:</B> -A simple locking facility – (<SPAN STYLE="font-style: normal"><B>Note:</B></SPAN> -<I>FreeFileSync already has a more powerful directory locking -mechanism implemented that allows multiple writers in parallel</I>)</FONT></P> -<P STYLE="margin-left: 1.32cm; margin-bottom: 0cm"><SPAN ID="Rahmen3" DIR="LTR" STYLE="float: left; width: 80%; height: 0.14cm; border: none; padding: 0cm; background: #e6e6e6"> - <P ALIGN=LEFT STYLE="margin-left: 0.79cm; margin-right: 0.98cm; margin-bottom: 0cm"> - <FONT FACE="Tahoma, sans-serif"><FONT FACE="Courier New, monospace">:tryAgain<BR>if - not exist \\share\folder\lock (<BR> </FONT><FONT COLOR="#808080"><FONT FACE="Courier New, monospace"><I><B>::create - the lock<BR> </B></I></FONT></FONT><FONT FACE="Courier New, monospace">echo - This is a lock file > \\share\folder\lock<BR> </FONT><FONT COLOR="#808080"><FONT FACE="Courier New, monospace"><I><B>::execute - the synchronization batch job synchronously<BR> </B></I></FONT></FONT><FONT FACE="Courier New, monospace">"C:\Program - Files\FreeFileSync\FreeFileSync.exe" - "C:\MySyncJob.ffs_batch"<BR> del - \\share\folder\lock<BR>) else (<BR> </FONT><FONT COLOR="#808080"><FONT FACE="Courier New, monospace"><I><B>::wait - 5 seconds then try starting sync again:<BR> </B></I></FONT></FONT><FONT FACE="Courier New, monospace">choice - /C:AB /T:5 /D:A > NUL<BR> goto tryAgain<BR>)</FONT></FONT></P> -</SPAN><BR CLEAR=LEFT><BR> -</P> </BODY> </HTML>
\ No newline at end of file |