29 Updating the local resository
29 Updating the local resository
Command
1
$ git pull
Code output
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
remote: Enumerating objects: 8, done.
remote: Counting objects: 100% (8/8), done.
remote: Compressing objects: 100% (5/5), done.
Unpacking objects: 100% (6/6), done.
remote: Total 6 (delta 1), reused 6 (delta 1), pack-reused 0
From https://github.com/redquinoa/health-checks
807cb50..b62dc2e master -> origin/master
* [new branch] experimental -> origin/experimental
Updating 807cb50..b62dc2e
Fast-forward
all_checks.py | 15 +++++++++++++++
1 file changed, 15 insertions(+)
Command
1
$ git -log -p -1
Code output
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
commit 922d65950b5325109525a24b71d8df8a46412d04 (HEAD -> master, origin/master, origin/HEAD)
Author: Blue Kale <bluekale@example.com>
Date: Mon Jan 6 14:42:44 2020 -0800
Add disk full check to all_checks.py
diff --git a/all_checks.py b/all_checks.py
index fdc4476..e46cdae 100755
--- a/all_checks.py
+++ b/all_checks.py
@@ -1,16 +1,31 @@
#!/usr/bin/env python3
import os
+import shutil
import sys
(...)
def(check_reboot):
""" Returns True if the computer has a pending reboot."""
Return os.path.exists(“/run/reboot-required”)
+def check_disk_full(disk, mmin_absolute, min_percent):
+ """Returns True if there isn’t enough disk space, False otherwise."""
+ du = shutil.disk_usage(disk)
+ # Calculate the percentage of free space
+ percent_free = 100 * du.free / du.total
+ # Calculate how many free gigabytes
Command
1
$ git remote show origin
Code output
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
* remote origin
Fetch URL: https://github.com/redquinoa/health-checks.git
Push URL: https://github.com/redquinoa/health-checks.git
HEAD branch: master
Remote branches:
experimental tracked
master tracked
Local branch configured for 'git pull':
master merges with remote master
Local ref configured for 'git push':
master pushes to master (up to date)
Command
1
$ git checkout experimental
Code output
1
2
3
Branch 'experimental' set up to track remote branch 'experimental' from 'origin'.
Switched to a new branch 'experimental'
This post is licensed under CC BY 4.0 by the author.