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
7d0b305b
Commit
7d0b305b
authored
Oct 28, 2011
by
Dietmar Maurer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add delete option to backup api
parent
2e368502
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
2 deletions
+20
-2
Backup.pm
PVE/API2/Backup.pm
+20
-2
No files found.
PVE/API2/Backup.pm
View file @
7d0b305b
...
...
@@ -178,7 +178,9 @@ sub write_vzdump_cron_config {
$param
.=
"
--
$p
"
.
PVE::Tools::
shellquote
(
$v
)
if
defined
(
$v
)
&&
$v
ne
'';
}
$param
.=
"
$job
->{vmid}
"
if
$job
->
{
vmid
};
if
(
$job
->
{
vmid
})
{
$param
.=
"
"
.
join
('
',
PVE::Tools::
split_list
(
$job
->
{
vmid
}));
}
$out
.=
sprintf
"
$minute
$hour
* * %-11s root vzdump
$param
\n
",
$dow
;
}
...
...
@@ -255,7 +257,6 @@ __PACKAGE__->register_method({
my
$data
=
cfs_read_file
('
vzdump
');
$param
->
{
minute
}
=
0
if
!
defined
(
$param
->
{
minute
});
$param
->
{
dow
}
=
'
mon,tue,wed,thu,fri,sat,sun
'
if
!
defined
(
$param
->
{
dow
});
$param
->
{
all
}
=
1
if
defined
(
$param
->
{
exclude
});
...
...
@@ -379,6 +380,11 @@ __PACKAGE__->register_method({
optional
=>
1
,
description
=>
"
Day of week selection.
",
},
delete
=>
{
type
=>
'
string
',
format
=>
'
pve-configid-list
',
description
=>
"
A list of settings you want to delete.
",
optional
=>
1
,
},
}),
},
returns
=>
{
type
=>
'
null
'
},
...
...
@@ -392,12 +398,24 @@ __PACKAGE__->register_method({
my
$jobs
=
$data
->
{
jobs
}
||
[]
;
die
"
no options specified
\n
"
if
!
scalar
(
keys
%
$param
);
raise_param_exc
({
all
=>
"
option conflicts with option 'vmid'
"})
if
$param
->
{
all
}
&&
$param
->
{
vmid
};
my
$delete
=
extract_param
(
$param
,
'
delete
');
foreach
my
$job
(
@$jobs
)
{
if
(
$job
->
{
id
}
eq
$param
->
{
id
})
{
foreach
my
$k
(
PVE::Tools::
split_list
(
$delete
))
{
if
(
!
PVE::VZDump::
option_exists
(
$k
))
{
raise_param_exc
({
delete
=>
"
unknown option '
$k
'
"
});
}
delete
$job
->
{
$k
};
}
foreach
my
$k
(
keys
%
$param
)
{
$job
->
{
$k
}
=
$param
->
{
$k
};
}
...
...
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