lsyncd/examples/lbash.lua

38 lines
805 B
Lua
Raw Normal View History

2010-10-19 10:20:27 +00:00
----
-- User configuration file for lsyncd.
2010-11-13 07:53:04 +00:00
--
-- This example uses local bash commands to keep two local
-- directory trees in sync.
2010-10-19 10:20:27 +00:00
--
2010-10-16 18:21:01 +00:00
settings = {
2010-11-12 11:04:45 +00:00
statusFile = "/tmp/lsyncd.stat",
statusIntervall = 1,
2010-10-16 18:21:01 +00:00
}
2010-11-13 08:00:07 +00:00
----
-- for testing purposes. prefix can be used to slow commands down.
-- prefix = "sleep 5 && "
prefix = ""
2010-11-05 18:20:33 +00:00
----
2010-11-01 16:38:39 +00:00
-- for testing purposes. uses bash command to hold local dirs in sync.
2010-10-22 10:35:26 +00:00
--
2010-11-13 08:00:07 +00:00
bash = {
2010-10-24 16:41:58 +00:00
delay = 5,
2010-11-12 11:04:45 +00:00
maxProcesses = 3,
2010-11-12 09:45:22 +00:00
2010-11-13 13:44:51 +00:00
onStartup =
[[if [ "$(ls -A $1)" ]; then cp -r ^source* ^target; fi]],
2010-10-22 10:35:26 +00:00
2010-11-13 13:44:51 +00:00
onCreate = prefix..[[cp -r ^sourcePathname ^targetPathname]],
onModify = prefix..[[cp -r ^sourcePathname ^targetPathname]],
onDelete = prefix..[[rm -rf ^targetPathname]],
2010-10-23 12:36:55 +00:00
2010-11-13 13:44:51 +00:00
onMove = prefix..[[mv ^o.targetPathname ^d.targetPathname]],
2010-10-22 10:35:26 +00:00
}
2010-11-13 08:00:07 +00:00
sync{bash, source="src", target="dst/"}
2010-10-16 18:21:01 +00:00