mirror of
https://github.com/octoleo/lsyncd.git
synced 2024-12-04 19:03:17 +00:00
fixed cleanup and lbash example
This commit is contained in:
parent
0656296463
commit
b73bbe3287
@ -26,8 +26,13 @@ bash = {
|
||||
maxProcesses = 1,
|
||||
|
||||
-- calls `cp -r SOURCE/* TARGET` only when there is something in SOURCE
|
||||
onStartup =
|
||||
[[if [ "$(ls -A ^source)" ]; then cp -r ^source* ^target; fi]],
|
||||
-- otherwise it deletes contents in the target if there.
|
||||
onStartup = [[
|
||||
if [ "$(ls -A ^source)" ]; then
|
||||
cp -r ^source* ^target;
|
||||
else
|
||||
if [ "$(ls -A ^target)" ]; then rm -rf ^target/*; fi
|
||||
fi]],
|
||||
|
||||
onCreate = prefix..[[cp -r ^sourcePath ^targetPathdir]],
|
||||
|
||||
|
7
lsyncd.c
7
lsyncd.c
@ -1660,12 +1660,13 @@ main1(int argc, char *argv[])
|
||||
int ci;
|
||||
struct logcat *lc;
|
||||
for(ci = 'A'; ci <= 'Z'; ci++) {
|
||||
for(lc = logcats[ci]; lc && lc->name; lc++) {
|
||||
for(lc = logcats[ci - 'A']; lc && lc->name; lc++) {
|
||||
free(lc->name);
|
||||
lc->name = NULL;
|
||||
}
|
||||
if (logcats[ci]) {
|
||||
free(logcats[ci]);
|
||||
if (logcats[ci - 'A']) {
|
||||
free(logcats[ci - 'A']);
|
||||
logcats[ci - 'A'] = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user