aboutsummaryrefslogtreecommitdiffstats
path: root/main/lsyncd/lpostcmd.patch
blob: 3525a066bcab55d716606580e8b7498304351936 (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
--- lsyncd-2.1.5/examples/lpostcmd.lua	2013-06-03 14:48:29.000000000 -0300
+++ ../lpostcmd.lua	2015-01-08 11:11:52.500886631 -0200
@@ -6,7 +6,7 @@
 -- after every successfullycompleted rsync operation.
 -- for example to restart servlets on the target host or so.
 
-local rsyncpostcmd = {
+rsyncpostcmd = {
 
 	-- based on default rsync.
 	default.rsync,
@@ -25,7 +25,7 @@
 			-- uses rawget to test if "isPostcmd" has been set without
 			-- triggering an error if not.
 			local isPostcmd = rawget(event, "isPostcmd")
-			if event.isPostcmd then
+			if isPostcmd then
 				spawn(event, "/usr/bin/ssh",
 					config.host, config.postcmd)
         		return
@@ -58,11 +58,11 @@
 			return default.collect(agent,exitcode)
 		end
 		error("this should never be reached")
-	end
+	end,
 
 	-- called before anything else
 	-- builds the target from host and targetdir
-	prepare = function(config)
+	prepare = function(config, level, skipTarget)
 		if not config.host then
 			error("rsyncpostcmd neets 'host' configured", 4)
 		end
@@ -72,16 +72,6 @@
 		if not config.target then
 			config.target = config.host .. ":" .. config.targetdir
 		end
-		return default.rsync.prepare(config)
+		return default.rsync.prepare(config, level, skipTarget)
 	end
 }
-
-
-sync {
-	rsyncpostcmd,
-	source = "src",
-	host = "beetle",
-	targetdir = "/path/to/trg",
-	postcmd = "/usr/local/bin/restart-servelt.sh",
-}
-