summaryrefslogtreecommitdiff
path: root/BUILD/Help/html/Batch Scripting.html
blob: 526d3d79501e2d5e38de7ea2878008f389ca7e19 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
	<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=windows-1252">
	<TITLE></TITLE>
	<META NAME="GENERATOR" CONTENT="OpenOffice.org 3.2  (Win32)">
	<META NAME="CREATED" CONTENT="20091206;16574000">
	<META NAME="CHANGED" CONTENT="20120511;23115700">
	<META NAME="Info 1" CONTENT="">
	<META NAME="Info 2" CONTENT="">
	<META NAME="Info 3" CONTENT="">
	<META NAME="Info 4" CONTENT="">
	<STYLE TYPE="text/css">
	<!--
		@page { margin: 2cm }
		P { margin-bottom: 0.21cm }
		H2.cjk { font-family: "SimSun" }
		H2.ctl { font-family: "Mangal" }
		A:link { so-language: zxx }
	-->
	</STYLE>
</HEAD>
<BODY LANG="en-US" DIR="LTR">
<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">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>
<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>
<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">&quot;C:\Program
	Files\FreeFileSync\FreeFileSync.exe&quot; &quot;H:\some
	folder\SyncJob.ffs_batch&quot;<BR>if errorlevel 1 (<BR>&nbsp;&nbsp;</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>&nbsp;&nbsp;</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>&nbsp;&nbsp;</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 &quot;An error occurred!&quot; you can also send an
email notification (using a third party tool).</FONT> 
</P>
<P STYLE="margin-bottom: 0cm"><BR>
</P>
<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 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 &quot;<I>Show progress dialog</I>&quot; or have &quot;On
		completion&quot; 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
		&quot;</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">&quot;
		to &quot;</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">&quot;
		or &quot;</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">&quot;.</SPAN></FONT></P>
	</UL>
</SPAN><BR CLEAR=LEFT><BR>
</P>
<P STYLE="margin-bottom: 0cm"><BR>
</P>
</BODY>
</HTML>
bgstack15