First!!! All of these scripts can be found on Github. Linky
$git clone https://github.com/kd8bny/randoScripts.git
FSTRIM
If anyone owns a solid-state drive (SSD) trim support is a basic requirement. The basic issue is that an SSD can write pages of memory but only delete blocks. Blocks of memory consist of many pages. i.e. (page << block) For a much more detailed explanation read here. However as of this moment Linux does not support trim automatically, but it is easily added to cron tasks. In case you are a Linux n00b cron tasks are located the system and are executed on a regular basis.Your choices of cron are:
- Hourly
- Daily
- Weekly
$sudo cp trim /etc/cron.weekly/BOOM! complete :) If you would like proof that is executes a log is created:
$cat /var/log/fstrim.logIMPORTANT!!!: Read README.md if you are using an LVM partition under EXT4.
Google Drive (grive)
As a Linux user you may know that Google has failed to provide a native drive client for us. This means you cant keep files synchronized on your drive and computer without doing so manually. Fortunately the group at The Fan Club saw the issue and provided us with grive. Grive is a 3rd party sync tool specifically for Linux. Despite how awesome this application is, it is missing an automatic synchronize. For this very reason I decided to create a cron bash script to take care of that, hence syncGrive. This script is capable of handling multiple accounts as long as they are under a single directory.This script uses the power of the grive application by The Fan Club. To add it:
$sudo apt-add-repository http://www.thefanclub.co.za/how-to/ubuntu-google-drive-client-grive-and-grive-toolsAfter the application is installed copy my srcipt to cron.
$sudo apt-get update && sudo apt-get install grive
$sudo cp trim /etc/cron.hourly/I personally run this hourly do to my extreme use of Google Drive, but choose what works for you the best.
IMPORTANT!!!:
- The script assumes the directory is "~/grive"
- If not change the directory in line 3
- By default grive does not delete removed files from the directory, however the script does. (README.md)
- To remove this comment: line 9:: rm -r .trash >> $LOG
$cat /var/log/syncGrive.log
No comments:
Post a Comment