Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
pve-backup-all
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jonas Leder
pve-backup-all
Commits
94493cee
Commit
94493cee
authored
Sep 26, 2021
by
Jonas Leder
Browse files
Options
Downloads
Patches
Plain Diff
Add new file
parent
2c67ddab
Branches
master
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
autobackup.sh
+23
-0
23 additions, 0 deletions
autobackup.sh
with
23 additions
and
0 deletions
autobackup.sh
0 → 100644
+
23
−
0
View file @
94493cee
#!/bin/bash
# Please mount the disk to the give path below before executing
mountPath
=
"/mnt/backup"
if
[[
!
$(
findmnt
-M
"
$mountPath
"
)
]]
;
then
echo
"Disk not mounted, can't continue"
exit
fi
echo
"Disk mounted, creating storage in proxmox"
pvesm add
dir
usb-disk-backup
--path
"
$mountPath
"
--content
backup
echo
"Storage in proxmoy created, running backups"
for
CT
in
$(
pct list |
grep
-v
VMID |
awk
'{print $1}'
)
;
do
vzdump
$CT
--compress
zstd
--remove
0
--storage
usb-disk-backup
--mode
snapshot
done
for
CT
in
$(
qm list |
grep
-v
VMID |
awk
'{print $1}'
)
;
do
vzdump
$CT
--compress
zstd
--remove
0
--storage
usb-disk-backup
--mode
snapshot
done
echo
"Backups complete, removing storage"
pvesm remove usb-disk-backup
echo
"Done, exiting"
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment