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
e5c63094
Commit
e5c63094
authored
3 weeks ago
by
efer
Browse files
Options
Downloads
Patches
Plain Diff
polish macos post-install
parent
f992d838
Branches
Branches containing commit
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
+44
-14
44 additions, 14 deletions
comp-backup-install.sh
with
44 additions
and
14 deletions
comp-backup-install.sh
+
44
−
14
View file @
e5c63094
...
...
@@ -685,25 +685,55 @@ echo -e "[backup script]" $G_"Installed"$_N
# macOS specific post-install
#
if
[
$HOST_OS
=
'Darwin'
]
;
then
echo
-e
$
Y
_
"
\n
NOTE:"
$_N
"The setup will now prepare your Mac to show notifications from the backup script"
echo
-e
"as well as doing a first run of the backup script so you can grant access permissions manually
\n
"
echo
-e
$
P
_
"
\n
########
\n
"
$_N
echo
-e
$Y_
"Prepare your Mac to show notifications from the backup script:
\n
"
$_N
read
-p
$'Press Enter/Return to start the Script Editor - Please click the "Play" button to display a notification
Allow the Script Editor to show notifications in the Notification Center
Optionally click the "Play" button again to verify
\n
'
read
-p
$' * Press Enter/Return to start the Script Editor
* Follow the instructions there and return here when done
\n
'
echo
'display notifcation "Allow to show notifications from scripts"'
>
/tmp/notification.applescript
echo
-e
"#
# Please click the 'Play' button in the header bar above to trigger a notification
#
# Click the notification pop-up to open the Notification Settings window
#
# Allow the Script Editor to show notifications
#
# Optionally click the 'Play' button in the Script Editor again to verify
#
# Close the Script Editor and continue with the backup install script
#
\n
"
>
/tmp/notification.applescript
echo
'display notification "Notifications from scripts working!"'
>>
/tmp/notification.applescript
open
-a
'Script Editor'
/tmp/notification.applescript
read
-rp
$'Please grant "rclone" access to Documents and Desktop folders when promted during the initial backup
Depending on how much data you already have, the initial backup can take a while
Do you want to run a backup now or postpone it for later? (y/n) [y] '
initialbackup
if
[[
$initialbackup
==
"y"
]]
;
then
sleep
5
read
-p
$' * Press Enter/Return to continue
\n
'
echo
-e
$Y_
"Grant folder access permissions:
\n
"
$_N
echo
-e
"During the first run of the backup script some access needs to be allowed
\n
Please grant"
$G_
"rclone"
$_N
"access to Desktop and Documents folders when promted
\n
This can also be done manually in:"
echo
"System Settings > Privacy & Security > Files & Folders"
echo
-e
"
\n
Depending on how much data you have, the first backup can take a while
\n
"
while
true
;
do
read
-p
"Do you want to run a backup now or postpone it for later? (y/n) "
initialbackup
case
$initialbackup
in
[
Yy]
*
)
echo
-e
"[backup script]"
$G_
"Running..."
$_N
launchctl load
$UNIT_DIR
/local.comp-backup.plist &>/dev/null
launchctl kickstart gui/
$(
id
-u
)
/local.comp-backup
break
;;
[
Nn]
*
)
echo
-e
$Y_
"
\n
Please make sure to allow folder access to rclone"
$_N
break
;;
esac
done
echo
-e
$P_
"
\n
########
\n
"
$_N
fi
#
# Finish
#
echo
-e
"
\n
DTU Compute backup script can be started manually with the command: "
$G_
"comp-backup
\n
"
$_N
echo
-e
"
\n
DTU Compute backup script can always be started manually with the command:"
echo
-e
$G_
"comp-backup
\n
"
$_N
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