summaryrefslogtreecommitdiff
path: root/FreeFileSync/Build/Help/html/RealtimeSync.html
blob: ecb1e4b9de9518bf68ac971fcb4c9dbe62f30172 (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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
<!doctype html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<link rel="stylesheet" type="text/css" href="base.css" >
	<title>RealtimeSync - Automated Synchronization</title>
</head>

<body>
	<H2 ALIGN=CENTER>
	<IMG SRC="../images/RTS_logo.png"><BR>
	<FONT SIZE=3><I><SPAN STYLE="font-weight: normal">Automated Synchronization</SPAN></I></FONT>
	</H2>

	<P>The primary purpose of RealtimeSync is to execute a command line each time it detects changes in one of the monitored directories
	<b>or</b> when a directory becomes available (e. g. insert of a USB-stick). Usually this command line will trigger a FreeFileSync batch job.
	</P>

	<BR>

	<B>Example:</B> Real time synchronization - in combination with FreeFileSync<br>
	<P>
	Start RealtimeSync.exe located in FreeFileSync's installation directory and 
	enter all folders you want to monitor. Instead of doing this manually you can import a ffs_batch
	file via <B>Menu &rarr; File &rarr; Open</B>. This not only extracts all directories relevant for synchronization
	but also sets up the command line to execute the ffs_batch file each time changes are detected.
	Now press <B>Start</B> to begin monitoring.
	</P>
	<div STYLE="margin-left: 1.3cm">
		<IMG SRC="../images/RealtimeSync.png">
	</div>
	<BR>
	<BR>

	<div class="bluebox">
		<div class="bluebox_inner">
				<B>Note</B>
				<ul STYLE="margin: 0">
					<LI>The command should <B>not</B> <B>block</B> progress. If you call a FreeFileSync batch job, make 
					sure it does not show any popup windows. See notes in <A HREF="Command%20line.html">Command Line Usage</A>.
					<BR>&nbsp;
					
					<LI>RealtimeSync will skip showing the main dialog and begin monitoring immediately if 
					you pass a ffs_real configuration file <B>or</B> a FreeFileSync ffs_batch file as first 
					command line argument to RealtimeSync.exe. This helps you integrate RealtimeSync into your operating system's auto start:<BR>				
					&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="command_line">&quot;C:\Program Files\FreeFileSync\RealtimeSync.exe&quot; &quot;D:\Backup Projects.ffs_real&quot;</span><BR>
					&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="command_line">&quot;C:\Program Files\FreeFileSync\RealtimeSync.exe&quot; &quot;D:\Backup Projects.ffs_batch&quot;</span>
					<BR>&nbsp;
			
					<LI>RealtimeSync is not tied to starting FreeFileSync. It can also be used in other scenarios, like sending an email whenever a certain directory is modified.
				</ul>
		</div>
	</div>
	<BR CLEAR=LEFT>
	<BR>
	<BR>

	<B>Example:</B> Automatic synchronization when a USB stick is inserted
	<P>Save a ffs_batch configuration in the USB stick's root directory, 
	e.g. <span class="file_path">H:\</span>, to let RealtimeSync call it when the stick is mounted. Configure RealtimeSync as follows:<BR>
	</P>
	<div STYLE="margin-left: 1.3cm">
		<IMG SRC="../images/WatchUsbInsert.png">
	</div>
	<BR>

	<P>Whenever directory <span class="file_path">H:\Data</span> becomes available, RealtimeSync executes the command line which starts the batch job located
	on the stick. RealtimeSync will also trigger each time files are modified in <span class="file_path">H:\Data</span>.
	</P>

	<div class="bluebox">
		<div class="bluebox_inner">
				<B>Note</B><BR>	
				The full path of the last changed file and the action that triggered the
				change notification (create, update or delete) are written
				to the environment variables <B><span class="command_line">%change_path%</span></B> and <B><span class="command_line">%change_action%</span></B>.
		</div>
	</div>
	<BR CLEAR=LEFT>
	<BR>
	<BR>

	<P><B>Example:</B> Log names of changed files and directories (Windows)</P>
	<div class="greybox">
		<div class="greybox_inner">
				Show which file or directory has triggered a change. Enter command line:<BR>			
				<span class="command_line">&nbsp;&nbsp;&nbsp;&nbsp;cmd /c echo %change_action% &quot;%change_path%&quot; &amp; pause</span>
				<BR><BR>
				Write a list of all changes to a log file:<BR>
				
				<span class="command_line">
					&nbsp;&nbsp;&nbsp;&nbsp;cmd /c echo %change_action% &quot;%change_path%&quot; &gt;&gt; %UserProfile%\Desktop\log.txt
				</span>
		</div>
	</div>
	<BR CLEAR=LEFT>

	<BR>

	<div class="bluebox">
		<div class="bluebox_inner">
				<b>Note</b><br>
				When RealtimeSync executes a Windows batch file (bat or cmd) a black console window is shown. You can hide it using the Visual Basic script
				<span class="file_path">HideConsole.vbs</span> located in FreeFileSync's installation directory:
				<br><br>			
				<span class="command_line">wscript &quot;C:\Program files\FreeFileSync\HideConsole.vbs&quot; C:\MyBatchFile.cmd</span>
		</div>
	</div>
	<BR CLEAR=LEFT>
	<BR>
	<BR>

	<h3>Limitations:</h3>
	<UL>
		<LI>If multiple changes happen at the same time, only the name of the first file is written to variable <b><span class="command_line">%changed_file%</span></b>.
		<LI>While RealtimeSync is executing the command line, monitoring is inactive and changes occurring during this time are not detected. 
	</UL>
</body>
</html>
bgstack15