In vim, press CtrlZ and Enter on the end of line 12.
Last active
August 29, 2015 14:04
-
-
Save zetavg/5af279c49a84d92c631c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
TASK_ID="AUTO_NCDU_$(date +'%a')" | |
echo "Starting $TASK_ID" | |
# Kill existing screen session | |
/opt/bin/screen -D -RR "$TASK_ID" -X quit || true | |
# Create screen and start rsync in it | |
/opt/bin/screen -dmS "$TASK_ID" | |
/opt/bin/screen -r "$TASK_ID" -p 0 -X stuff "/opt/bin/ncdu /volume1 | |
" | |
# Notify in DSM at start | |
/usr/syno/bin/synodsmnotify @administrators "$TASK_ID auto ncdu starting" "Use the command \`# screen -R $TASK_ID\` via ssh to see the progress." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment