GnuRAMage is a sophisticated yet humble Bash tool that bridges the gap between your sluggish rotating rust (hard drives) and the blazing fast silicon heaven (RAM disks). It's like having a very diligent intern who never sleeps, constantly ensuring your files are where they should be, when they should be there.
This tool was born out of the necessity to manage multi-terabyte RAM disks without losing one's sanity or data. Because let's face it, having terabytes of RAM without proper synchronization is like having a Ferrari without brakes - exciting, but ultimately catastrophic.
- What is GnuRAMage?
- Features
- Why Would You Want This?
- Requirements
- Installation
- Configuration
- Usage
- Examples
- Testing
- Contributing
- License
- Author
GnuRAMage comes packed with features that would make even the most demanding sysadmin shed a tear of joy:
- Automatic File Copying: Intelligently copies files from hard disk to RAM disk (because manual copying is for peasants)
- Periodic Synchronization: Regular sync-back to hard disk (because RAM is volatile, unlike our commitment to data integrity)
- Exclusion Patterns: Support for excluding files and directories (because not everything deserves the store non-volatile)
- INI Configuration: Human-readable configuration format (unlike some tools that use hieroglyphics)
- Comprehensive Logging: Multiple log levels and optional error-only logs (for when you want to pretend everything is fine)
- Dry Run Mode: Test operations without actually doing anything (for the cautious and the paranoid)
- One-time Mode: Single synchronization cycle (for those commitment-phobic moments)
- Signal Handling: Graceful shutdown on interruption (because even tools need manners)
- Checksum Verification: Optional data integrity checks (for the truly paranoid)
- Script Generation: Creates standalone scripts for automation (delegation at its finest)
You have a massive RAM disk - perhaps several terabytes of the finest DDR5 money can buy. You want to use it for frequently accessed files to achieve ludicrous speed improvements. But you also don't want to lose your data when the power goes out, the cat trips over the power cord, or the universe decides to have a cosmic ray event.
GnuRAMage acts as your faithful guardian, ensuring that:
- Your files get copied to the RAM disk for blazing fast access
- Changes are periodically synchronized back to persistent storage
- Your data survives power outages, system crashes, and acts of feline interference
- You can sleep peacefully knowing your multi-thousand-dollar RAM investment is properly protected
In true GNU tradition, GnuRAMage is:
- Free (as in freedom, not as in "free puppy that costs $500/month in food")
- Extensible (modify it to your heart's content)
- Well-documented (this README is proof of our commitment to verbosity)
- Standards-compliant (follows POSIX where possible, and good sense everywhere else)
- Bash: Version 4.0 or later (because life's too short for ancient shells)
- rsync: The Swiss Army knife of file synchronization
- GNU/Linux: Any reasonably modern distribution (we're not picky, but we have standards)
- Sufficient RAM: Ideally measured in terabytes, but we won't judge your modest gigabytes
- Coffee: Optional but highly recommended for optimal performance (applies to both you and the system)
-
Clone this repository (or download it like it's 1999):
git clone git@github.com:FPGArtktic/GnuRAMage.git cd GnuRAMage
-
Make the script executable (because files don't execute themselves):
chmod +x gramage.sh
-
Edit the configuration file to match your setup:
cp GnuRAMage.ini.example GnuRAMage.ini $EDITOR GnuRAMage.ini
wget https://github.com/FPGArtktic/GnuRAMage/blob/master/gramage.sh
wget https://github.com/FPGArtktic/GnuRAMage/blob/master/GnuRAMage.ini
chmod +x gramage.sh
# Edit configuration as needed
GnuRAMage uses an INI-style configuration file that's so simple, even a Windows user could understand it. The file is divided into logical sections:
# How often to sync (in seconds). 180 = 3 minutes of procrastination
sync_interval = 180
# Log verbosity: ERROR (silent treatment), WARN (passive aggressive),
# INFO (chatty), DEBUG (verbose to the point of annoyance)
log_level = INFO
# Verify checksums? true = paranoid but safe, false = living dangerously
verify_checksums = false
# Where your precious files currently live (the slow storage)
source_dir = /path/to/your/slow/storage
# Where your files will achieve enlightenment (the fast storage)
ramdisk_dir = /path/to/your/blazing/fast/ramdisk
Patterns for files you don't want cluttering your HDD:
# Backup files (because backup-of-backups is just hoarding)
*.bak
*.tmp
# Temporary files (the digital equivalent of junk mail)
temp_*
# That one directory you created and forgot about
forgotten_project_from_2019/
./gramage.sh [OPTIONS]
Option | Description | Example |
---|---|---|
--config <file> |
Use custom config file | --config my_setup.ini |
--dry-run |
Simulate without actual changes | Perfect for the commitment-phobic |
--verbose or -v |
Detailed output | For when you want to know everything |
--logs <file> |
Write logs to file | --logs sync.log |
--errors-log <file> |
Separate error log | --errors-log errors.log |
--script-gen-only |
Generate scripts and exit | For the delegation enthusiasts |
--one-time |
Single sync cycle | One and done |
--help |
Display help | When all else fails |
Start GnuRAMage with default settings:
./gramage.sh
This will:
- Read
GnuRAMage.ini
- Copy files to RAM disk
- Start periodic synchronization
- Run until interrupted (Ctrl+C like a civilized person)
Run with verbose output and comprehensive logging:
./gramage.sh --verbose --logs detailed.log --errors-log problems.log
Try before you buy with dry-run mode:
./gramage.sh --dry-run --verbose
This shows you what would happen without actually doing it - like a preview of your life choices.
For those commitment-averse moments:
./gramage.sh --one-time --verbose
Generate automation scripts without starting the sync:
./gramage.sh --script-gen-only
This creates:
gramage_copy_to_ram.sh
- Initial copy scriptgramage_sync_to_disk.sh
- Periodic sync script
Perfect for integrating with your existing automation or cron jobs.
Use a different configuration file:
./gramage.sh --config production.ini --logs production.log
We've included a comprehensive test suite because untested code is like unverified file transfers - a recipe for disaster.
cd test
./run_test.sh
The test suite verifies:
- Script existence and permissions (basic sanity checks)
- Configuration parsing (because INI files can be tricky)
- Script generation (delegation functionality)
- File operations (the core purpose of our existence)
- Exclusion patterns (making sure ignored files stay ignored)
- Logging functionality (documenting our achievements and failures)
Create a test environment with sample files:
cd test
./test_generator.sh --files 100 --dirs 10 --size 1M
This creates a realistic test environment with:
- Multiple directories with nested structures
- Various file types and sizes
- Files that should be excluded (to test our exclusion logic)
GnuRAMage follows the UNIX philosophy: do one thing and do it well. That one thing happens to be "make your files faster while keeping them safe," which admittedly is more like two things, but who's counting?
- Initialization: Parse configuration, check dependencies, validate paths
- Initial Copy: Copy files from slow storage to fast storage
- Monitoring Loop: Periodically sync changes back to persistent storage
- Graceful Shutdown: On interruption, perform final sync and cleanup
- Uses
rsync
for efficient synchronization (because reinventing the wheel is overrated) - Employs intelligent exclusion patterns (your
.tmp
files don't deserve RAM) - Provides comprehensive logging (for debugging and bragging rights)
- Handles signals gracefully (manners matter, even in code)
"rsync not found"
- Install rsync:
sudo apt-get install rsync
(Debian/Ubuntu) or equivalent
"Permission denied"
- Check file permissions:
chmod +x gramage.sh
- Verify directory access rights
"Configuration file not found"
- Ensure
GnuRAMage.ini
exists in the script directory - Use
--config
to specify a different location
"RAM disk not mounted"
- Verify your RAM disk is properly mounted
- Check mount points with
mount | grep tmpfs
- Read this README (you're already doing great!)
- Check the logs (they're surprisingly informative)
- Use
--dry-run --verbose
to see what's happening - File an issue (we're surprisingly responsive)
Contributions are welcome! This is free software, after all. Whether you want to:
- Fix bugs (our favorite kind of contribution)
- Add features (preferably ones that make sense)
- Improve documentation (because more words are always better)
- Write tests (the unsung heroes of software development)
Please follow these guidelines:
- Follow GNU coding standards (or at least pretend to)
- Write tests (your future self will thank you)
- Update documentation (this README won't update itself)
- Use meaningful commit messages ("fix stuff" is not meaningful)
- Use 4 spaces for indentation (not tabs, we're not barbarians)
- Comment your code (future you is practically a different person)
- Follow existing conventions (consistency is key)
- Keep functions focused (do one thing well)
Found a bug? Congratulations! You've contributed to the improvement of this software. Please report it with:
- Clear description of the problem
- Steps to reproduce (be specific)
- Expected vs actual behavior
- Log files if available
- System information (OS, RAM size, phase of moon)
Ideas for future versions (contributions welcome):
- Web interface (because everything needs a web interface these days)
- Real-time monitoring (for the dashboard enthusiasts)
- Multiple RAM disk support (because more is always better)
- Compression support (squeeze more files into that precious RAM)
- Network synchronization (for the distributed storage aficionados)
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.
- Use it for whatever you want (commercial, personal, world domination)
- Modify it to your heart's content
- Share it with friends, enemies, and random strangers
- Don't blame us if it breaks something (though we tried really hard to make it not break things)
Mateusz Okulanis
Email: FPGArtktic@outlook.com
Creator, maintainer, and chief RAM disk enthusiast. Available for consulting, debugging sessions, and philosophical discussions about the nature of persistent vs. volatile storage.
"In a world full of slow storage, be the RAM disk synchronization tool." - Ancient GNU Proverb (probably)
Note: This software was developed with love, caffeine, and an unhealthy obsession with making things faster. Use responsibly.