Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
freedombone
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
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
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Context Sensitive Group
freedombone
Commits
007ff09b
Commit
007ff09b
authored
6 years ago
by
Bob Mottram
Browse files
Options
Downloads
Patches
Plain Diff
If backup drive is getting too full then remove backup directory before creating new backup
parent
5aecfae5
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/freedombone-backup-local
+10
-5
10 additions, 5 deletions
src/freedombone-backup-local
with
10 additions
and
5 deletions
src/freedombone-backup-local
+
10
−
5
View file @
007ff09b
...
...
@@ -90,11 +90,16 @@ function make_backup_directory {
function
check_storage_space_remaining
{
# Check space remaining on the usb drive
used_percent
=
$(
df
-k
$USB_MOUNT
|
tail
-n
1 |
awk
-F
' '
'{print $5}'
|
awk
-F
'%'
'{print $1}'
)
if
[
"
$used_percent
"
-gt
95
]
;
then
echo
$"Less than 5% of space remaining on backup drive"
umount
$USB_MOUNT
rm
-rf
$USB_MOUNT
exit
4
if
[
"
$used_percent
"
-gt
80
]
;
then
echo
$"Less than 20% of space remaining on backup drive"
if
[
-d
$USB_MOUNT
/backup
]
;
then
echo
$"Deleting existing backup directory"
rm
-rf
$USB_MOUNT
/backup
else
umount
$USB_MOUNT
rm
-rf
$USB_MOUNT
exit
4
fi
fi
}
...
...
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