Git Product home page Git Product logo

thedrhax-tmpfize's Introduction

thedrhax-tmpfize

Copy any directory to RAM (tmpfs) and automatically synchronize it with HDD.

Selected directory will be copied to tmpfs and replaced with symlink. Backup of directory will be created and placed in the same path to avoid data loss (backup will be restored automatically on next mount).

Dependencies

  • rsync
  • realpath

Installation

This is a standalone script which doesn't need installation to work but it can be installed into system for easier access.

At the moment, there are three ways to install this script:

1. Build .deb package

Dependencies:

  • fakeroot

You can build .deb package using Makefile:

make deb

And then install it with dpkg:

sudo dpkg -i thedrhax-tmpfize-*.deb

2. Install using Makefile

You can copy tmpfize into /usr/bin using Makefile: sudo make install

Also you can uninstall tmpfize with sudo make uninstall

3. Install from my APT repository

echo "deb http://local.thedrhax.pw/apt/stable/ /" | sudo tee "/etc/apt/sources.list.d/thedrhax.list"
wget -O- http://local.thedrhax.pw/apt/TheDrHax.key | sudo apt-key add -
sudo apt-get update
sudo apt-get install thedrhax-tmpfize

Usage

Command accepts one argument (path of directory that should be moved to tmpfs).

tmpfize [-hrvpu] [-t interval] SOURCE_DIR[.tar.gz] ... -- [COMMAND]

Options:

Technical:
 -h		        - Show help page.
 -v		        - Show info messages.

Mount Settings:
 SOURCE_DIR	    - Path or name of directory that will be moved to tmpfs.

 -t interval	- Synchronize interval in seconds (default: 30, 0 to disable).
		  
 -p       		- Do not delete directory from tmpfs after unmounting.
		  
 -r		        - Mount read only. Any changes in a tmpfs copy will not be
		          saved after unmounting. [DANGEROUS]

Execute scripts:
 COMMAND	    - Execute this command after moving directory to tmpfs.
	              When command is finished, directory will be moved back.

Mount control:
 -u		        - Unmount directory.

Examples

  • Mount and unmount existing directory
# mount
tmpfize directory_name

# unmount
tmpfize -u directory_name
  • Mount directory with disabled synchronization (directory will be synced after unmount)
tmpfize -t 0 directory_name
  • Mount read-only directory (all changes will be lost after unmount)
tmpfize -r directory_name
  • Start a custom script after mounting
tmpfize directory_name -- script_name
  • Mounting a .tar.gz archive (since v1.3.0): archive will be unpacked to tmpfs and packed back after unmount
tmpfize directory_name.tar.gz
  • Mounting multiple directories
tmpfize first_directory second_directory

thedrhax-tmpfize's People

Contributors

thedrhax avatar

Watchers

 avatar  avatar  avatar

thedrhax-tmpfize's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.