Skip to content

Commit

Permalink
Changed cron and readme for new option
Browse files Browse the repository at this point in the history
  • Loading branch information
Unknown committed Jul 30, 2017
1 parent 595006a commit fcdd431
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
These scripts are created to have your media synced between your cloud- and local store. All media is always encrypted before being uploaded.
This also means if you loose your encryption keys you can't read your media.

**Plexdrive version 4.0.0 and Rclone version 1.36 is used.**
**Plexdrive version 4.0.0 and Rclone version 1.36 is used.**

There is a setup file, `setup.sh`, to install the necessary stuff automatically. This has only been tested on Ubuntu 16.04+.

Expand Down Expand Up @@ -56,10 +56,12 @@ These should be inserted into `crontab -e`.

- Cron is set up to mount at boot.
- Upload to cloud daily.
- Check to remove local content monthly (this only remove files older than `remove_files_older_than`).
- Check to remove local content weekly (this only remove files depending on the option 'space' or 'time'*).

_If you have a small local disk you may change upload to hourly and remove local content to daily or weekly._

*_If 'space' is set it will only remove content, starting from the oldest accessed file, if media size has exceeded `remove_files_when_space_exceeds` and will only free up atleast `freeup_atleast`. If 'time' is set it will only remove files older than `remove_files_older_than`_

# How this works?
Following services are used to sync, encrypt/decrypt and mount media:
- Plexdrive
Expand Down
2 changes: 1 addition & 1 deletion cron
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
@reboot ./scripts/mount.remote &>> ./logs/mount.log
@daily ./scripts/cloudupload &>> ./logs/cloudupload.log
@monthly ./scripts/rmlocal &>> ./logs/rmlocal.log
@weekly ./scripts/rmlocal &>> ./logs/rmlocal.log
6 changes: 3 additions & 3 deletions scripts/rmlocal
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ rm_space () {
addedSpace="$(($addedSpace + $fileSize))"

fileSizeGb=$(($fileSize / 1000 / 1000 / 1000))

# Move file to remote destination[s], retaining path
echo "[ $(date ${date_format}) ] Moving file -> ${n} to Google Drive. Freeing up ${fileSizeGb} GB"
"${rclone_bin}" move --config="${rclone_cfg}" "$n" "${rclone_cloud_endpoint}${destpath}" >/dev/null 2>&1
Expand All @@ -101,9 +101,9 @@ if pidof -o %PPID -x "$(basename "$0")"; then
exit 3
fi

if [ "$remove_files_based_on" == "space"]; then
if [ "$remove_files_based_on" = "space" ]; then
rm_space
elif [ "$remove_files_based_on" == "time"]; then
elif [ "$remove_files_based_on" = "time" ]; then
rm_time
else
echo "[ $(date ${date_format}) ] no option to remove old files"
Expand Down

0 comments on commit fcdd431

Please sign in to comment.