Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pve-manager
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
pve-manager
Commits
7dcce29d
Commit
7dcce29d
authored
Nov 28, 2011
by
Dietmar Maurer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
allow exclude-path in /etc/vzdump.conf
parent
d9a6d2f5
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
2 deletions
+18
-2
VZDump.pm
PVE/API2/VZDump.pm
+1
-1
VZDump.pm
PVE/VZDump.pm
+15
-1
vzdump
bin/vzdump
+1
-0
vzdump.conf
vzdump.conf
+1
-0
No files found.
PVE/API2/VZDump.pm
View file @
7dcce29d
...
...
@@ -71,7 +71,7 @@ __PACKAGE__->register_method ({
# exclude-path list need to be 0 separated
my
@expaths
=
split
(
/\0/
,
$param
->
{'
exclude-path
'}
||
'');
$param
->
{'
exclude-path
'}
=
@expaths
;
$param
->
{'
exclude-path
'}
=
[
@expaths
]
;
my
@mailto
=
PVE::Tools::
split_list
(
extract_param
(
$param
,
'
mailto
'));
$param
->
{
mailto
}
=
[
@mailto
];
...
...
PVE/VZDump.pm
View file @
7dcce29d
...
...
@@ -212,6 +212,8 @@ sub read_vzdump_defaults {
$res
->
{
size
}
=
int
(
$1
);
}
elsif
(
$line
=~
m/maxfiles:\s*(\d+)\s*$/
)
{
$res
->
{
maxfiles
}
=
int
(
$1
);
}
elsif
(
$line
=~
m/exclude-path:\s*(.*)\s*$/
)
{
$res
->
{'
exclude-path
'}
=
PVE::Tools::
split_args
(
$1
);
}
elsif
(
$line
=~
m/mode:\s*(stop|snapshot|suspend)\s*$/
)
{
$res
->
{
mode
}
=
$1
;
}
else
{
...
...
@@ -455,6 +457,12 @@ sub new {
$self
->
find_add_exclude
('
-type
',
'
s
');
# skip sockets
if
(
$defaults
->
{'
exclude-path
'})
{
foreach
my
$path
(
@
{
$defaults
->
{'
exclude-path
'}})
{
$self
->
find_add_exclude
('
-regex
',
$path
);
}
}
if
(
$opts
->
{'
exclude-path
'})
{
foreach
my
$path
(
@
{
$opts
->
{'
exclude-path
'}})
{
$self
->
find_add_exclude
('
-regex
',
$path
);
...
...
@@ -1172,7 +1180,13 @@ sub command_line {
next
if
$p
eq
'
id
'
||
$p
eq
'
vmid
'
||
$p
eq
'
starttime
'
||
$p
eq
'
dow
';
my
$v
=
$param
->
{
$p
};
my
$pd
=
$confdesc
->
{
$p
}
||
die
"
no such vzdump option '
$p
'
\n
";
$cmd
.=
"
--
$p
"
.
PVE::Tools::
shellquote
(
$v
)
if
defined
(
$v
)
&&
$v
ne
'';
if
(
$p
eq
'
exclude-path
')
{
foreach
my
$path
(
split
(
/\0/
,
$v
||
''))
{
$cmd
.=
"
--
$p
"
.
PVE::Tools::
shellquote
(
$path
);
}
}
else
{
$cmd
.=
"
--
$p
"
.
PVE::Tools::
shellquote
(
$v
)
if
defined
(
$v
)
&&
$v
ne
'';
}
}
return
$cmd
;
...
...
bin/vzdump
View file @
7dcce29d
...
...
@@ -123,6 +123,7 @@ Global configuration is stored in /etc/vzdump.conf.
size: MB
maxfiles: N
script: FILENAME
exclude-path: PATHLIST
=head1 HOOK SCRIPT
...
...
vzdump.conf
View file @
7dcce29d
...
...
@@ -11,3 +11,4 @@
#size: MB
#maxfiles: N
#script: FILENAME
#exclude-path: PATHLIST
Write
Preview
Markdown
is supported
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