Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
comp-backup
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
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
ITS
comp-backup
Commits
812d27ce
Commit
812d27ce
authored
1 month ago
by
efer
Browse files
Options
Downloads
Patches
Plain Diff
linux distro install rclone/age
parent
85125e48
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
comp-backup-install.sh
+29
-16
29 additions, 16 deletions
comp-backup-install.sh
with
29 additions
and
16 deletions
comp-backup-install.sh
+
29
−
16
View file @
812d27ce
...
@@ -101,22 +101,35 @@ elif [ $HOST_OS = 'Linux' ]; then
...
@@ -101,22 +101,35 @@ elif [ $HOST_OS = 'Linux' ]; then
HOST
=
$(
hostname
-s
)
HOST
=
$(
hostname
-s
)
NOTIFY0
=
'notify-send -a "DTU Compute backup script" -i network-transmit "Backup done"'
NOTIFY0
=
'notify-send -a "DTU Compute backup script" -i network-transmit "Backup done"'
NOTIFY1
=
'notify-send -a "DTU Compute backup script" -i network-error "Backup did not complete"'
NOTIFY1
=
'notify-send -a "DTU Compute backup script" -i network-error "Backup did not complete"'
DISTRO
=
$(
grep
-Ew
"ID|ID_LIKE"
/etc/os-release |cut
-d
'='
-f
2
)
if
[[
${
DISTRO
[*]
}
=
~ debian
]]
||
[[
${
DISTRO
[*]
}
=
~ ubuntu
]]
;
then
PKGMAN
=
"apt"
elif
[[
${
DISTRO
[*]
}
=
~ fedora
]]
;
then
PKGMAN
=
"dnf"
fi
# Check for necessary programs
# Check for necessary programs
which rclone &>/dev/null
for
prog
in
rclone age
;
do
which
$prog
&>/dev/null
if
[
$?
-ne
0
]
;
then
if
[
$?
-ne
0
]
;
then
if
[[
-z
$PKGMAN
]]
;
then
echo
-e
$R_
"rclone command not installed"
$_N
echo
-e
$R_
"rclone command not installed"
$_N
echo
-e
"Install it using your distro package manager
:"
$G_
"<package_manager> install rclone"
$_N
echo
-e
"Install it using your distro package manager
or manually from
$prog
project website"
echo
-e
"
and
run this script again afterwards
\n
"
echo
-e
"
Then
run this script again afterwards
\n
"
exit
1
exit
1
fi
else
echo
-e
$Y_
"Installing
$prog
using
$PKGMAN
"
$_N
"- you may be asked for your password"
which age &>/dev/null
chksudo
sudo
$PKGMAN
install
$prog
&>/dev/null
if
[
$?
-ne
0
]
;
then
if
[
$?
-ne
0
]
;
then
echo
-e
$R_
"age command not installed"
$_N
echo
-e
$R_
"
\n
Could not find
$prog
in distro repo"
$_N
echo
-e
"Install it using your distro package manager:"
$G_
"<package_manager> install age"
$_N
echo
-e
"Please install manually from
$prog
project website and run this script again afterwards
\n
"
echo
-e
"and run this script again afterwards
\n
"
exit
1
exit
1
else
echo
-e
"[
$prog
]"
$G_
"OK"
$_N
fi
fi
fi
fi
done
# SYSTEMD
# SYSTEMD
which systemctl &>/dev/null
which systemctl &>/dev/null
if
[
$?
-ne
0
]
;
then
if
[
$?
-ne
0
]
;
then
...
@@ -137,7 +150,7 @@ fi
...
@@ -137,7 +150,7 @@ fi
# User Specific Variables
# User Specific Variables
#
#
USER
=
$(
whoami
)
USER
=
$(
whoami
)
echo
-n
"Enter your DTU username [
$USER
]: "
echo
-n
"
\n
Enter your DTU username [
$USER
]: "
read
ANS
read
ANS
case
$ANS
in
case
$ANS
in
""
)
""
)
...
...
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