mirror of
https://github.com/YunoHost/package_check.git
synced 2024-09-03 20:06:20 +02:00
Remove swap before creating snapshots
This commit is contained in:
parent
849dc78922
commit
5e401923d5
1 changed files with 8 additions and 0 deletions
|
@ -75,6 +75,14 @@ create_temp_backup () {
|
|||
# Stop the container, before its snapshot
|
||||
sudo lxc-stop --name $lxc_name >&2
|
||||
|
||||
# Remove swap files to avoid killing the CI with huge snapshots.
|
||||
local swap_file="/var/lib/lxc/$lxc_name/rootfs/swap_$ynh_app_id"
|
||||
if [ -e "$swap_file" ]
|
||||
then
|
||||
sudo swapoff "$swap_file"
|
||||
sudo rm "$swap_file"
|
||||
fi
|
||||
|
||||
# Check if the snapshot already exist
|
||||
if [ ! -e "$snapshot_path/snap$snap_number" ]
|
||||
then
|
||||
|
|
Loading…
Add table
Reference in a new issue