Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
ef320fa8
Commit
ef320fa8
authored
Sep 05, 2006
by
Leigh B. Stoller
Browse files
Add --delete option to sync directive, to schedule a clean for the
next sync (similar to how it works with the archive directive).
parent
d6c7be57
Changes
1
Hide whitespace changes
Inline
Side-by-side
utils/loghole.in
View file @
ef320fa8
...
...
@@ -1239,6 +1239,7 @@ def do_sync(args, mode="sync", must_be_active=1, as_root=False):
global
DPDBNAME
,
COLLAB_PW
retval
=
0
delete_dir
=
False
logdir
=
os
.
path
.
join
(
EXPDIR_FMT
%
{
"PID"
:
PID
,
"EID"
:
EID
},
"logs"
)
...
...
@@ -1248,9 +1249,8 @@ def do_sync(args, mode="sync", must_be_active=1, as_root=False):
extra_logholes
=
[]
try
:
opts
,
node_list
=
getopt
.
getopt
(
args
,
"nl:r:Ps"
,
[
"no-standard"
,
"local="
,
"remote="
,
])
opts
,
node_list
=
getopt
.
getopt
(
args
,
"nl:r:Psd"
,
[
"no-standard"
,
"local="
,
"remote="
,
"delete"
])
for
opt
,
val
in
opts
:
if
opt
in
(
"-n"
,
"--no-standard"
):
standard_logholes
=
False
...
...
@@ -1271,6 +1271,9 @@ def do_sync(args, mode="sync", must_be_active=1, as_root=False):
elif
opt
in
(
"-s"
,
"--snapshot"
):
snapshot_traces
=
True
pass
elif
opt
in
(
"-d"
,
"--delete"
):
delete_dir
=
True
pass
pass
pass
except
getopt
.
error
,
e
:
...
...
@@ -1630,6 +1633,13 @@ def do_sync(args, mode="sync", must_be_active=1, as_root=False):
pass
pass
# Schedule clean
if
delete_dir
:
os
.
chdir
(
logdir
)
open
(
CLEANFILE
,
'w'
)
os
.
chmod
(
CLEANFILE
,
0664
)
pass
return
retval
##
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment