Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
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
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
Main
Synchronet
Commits
1304cec8
Commit
1304cec8
authored
22 years ago
by
rswindell
Browse files
Options
Downloads
Patches
Plain Diff
Uses new system.freespacek property.
Added cvs ID keyword. Fixed conversion of file_area.min_diskspace.
parent
22d5fd73
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
exec/chkspace.js
+7
-5
7 additions, 5 deletions
exec/chkspace.js
with
7 additions
and
5 deletions
exec/chkspace.js
+
7
−
5
View file @
1304cec8
...
@@ -2,18 +2,20 @@
...
@@ -2,18 +2,20 @@
// Requires minimum free disk space (in megabytes) as first argument
// Requires minimum free disk space (in megabytes) as first argument
// $Id$
// Example: "?chkspace 100"
// Example: "?chkspace 100"
minspace
=
file_area
.
min_diskspace
*
2
;
minspace
=
file_area
.
min_diskspace
*
2
;
freespace
=
system
.
freediskspace
;
freespace
=
system
.
freediskspace
k
;
// new property in v3.10L
if
(
argc
)
if
(
argc
)
minspace
=
Number
(
argv
[
0
])
;
minspace
=
Number
(
argv
[
0
])
*
1024
;
// convert megabytes to kilobytes
if
(
freespace
==-
1
||
freespace
>
minspace
*
1024
*
1024
)
if
(
freespace
==-
1
||
freespace
>
=
minspace
)
exit
();
// everything's fine
exit
();
// everything's fine
log
(
"
!Low disk space:
"
+
freespace
+
"
bytes
"
);
log
(
"
!Low disk space:
"
+
freespace
+
"
kilo
bytes
"
);
msgbase
=
new
MsgBase
(
"
mail
"
);
msgbase
=
new
MsgBase
(
"
mail
"
);
if
(
msgbase
.
open
!=
undefined
&&
msgbase
.
open
()
==
false
)
{
if
(
msgbase
.
open
!=
undefined
&&
msgbase
.
open
()
==
false
)
{
...
@@ -23,7 +25,7 @@ if(msgbase.open!=undefined && msgbase.open()==false) {
...
@@ -23,7 +25,7 @@ if(msgbase.open!=undefined && msgbase.open()==false) {
hdr
=
{
to
:
'
sysop
'
,
to_ext
:
'
1
'
,
from
:
'
chkspace
'
,
subject
:
'
Low disk space notification
'
}
hdr
=
{
to
:
'
sysop
'
,
to_ext
:
'
1
'
,
from
:
'
chkspace
'
,
subject
:
'
Low disk space notification
'
}
if
(
!
msgbase
.
save_msg
(
hdr
,
"
WARNING: Only
"
+
freespace
+
"
bytes of free disk space on
"
if
(
!
msgbase
.
save_msg
(
hdr
,
"
WARNING: Only
"
+
freespace
+
"
kilo
bytes of free disk space on
"
+
system
.
timestr
()))
+
system
.
timestr
()))
log
(
"
!Error
"
+
msgbase
.
last_error
+
"
saving mail message
"
);
log
(
"
!Error
"
+
msgbase
.
last_error
+
"
saving mail message
"
);
...
...
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