-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create dir2ram #1
Conversation
Hi, Following on your good work, I've created a new version of folder2ram called dir2ram which extends the work to accomplish most of your todo list as well as fixing some of the bugs that I've experienced (long directory mangling, services needing to be stopped). I was hoping you could give feedback on features and any bugs you encounter. Summary: - Stops dependent service(s), starts the tmpfs|ramfs drive, then restarts services for mounts. Same for unmounts as well. - Allows tmpfs or ramfs RAM drives. - Allows you to set a maximum size of drive. - Checks the size of the directory and warns if it is larger than specified in the config file. - Optionally prunes logs back to user specified level before syncing to disk. - Automated daily syncs back to disk. - Lots of sanity and safety checks. Example Config file: # # EXAMPLE: # Name FS MB LogHist Dependent_Service(s) Dir_To_Cache smart tmpfs 8 5 smartd,smartmontools /var/lib/smartmontools # sickbeard tmpfs 256 5 sickbeard /var/opt/sickbeard # couch tmpfs 256 5 couchpotato /home/couchpotato samba tmpfs 16 5 samba /var/cache/samba ntp tmpfs 8 5 ntp /var/lib/ntp # minidlna tmpfs 16 5 minidlna /var/cache/minidlna # # Covered by folder2ram: log tmpfs 256 8 /var/log vartmp tmpfs 512 5 /var/tmp spool tmpfs 32 5 postfix /var/spool rrd tmpfs 8 5 rrdcached /var/lib/openmediavault/rrd rrdcached tmpfs 256 5 rrdcached /var/lib/rrdcached monit tmpfs 8 5 monit /var/lib/monit php tmpfs 8 5 php5-fpm /var/lib/php5 Example Status: Name Space FileS Real Directory Mounted tmpfs|ramfs ==== ===== ===== ============== =================== rrdcached 16M/256M tmpfs /var/dir2ram/dir2ram_rrdcached /var/lib/rrdcached ntp 1M/8M tmpfs /var/dir2ram/dir2ram_ntp /var/lib/ntp vartmp 0M/512M tmpfs /var/dir2ram/dir2ram_vartmp /var/tmp rrd 1M/8M tmpfs /var/dir2ram/dir2ram_rrd /var/lib/openmediavault/rrd php 1M/8M tmpfs /var/dir2ram/dir2ram_php /var/lib/php5 smart 0M/8M tmpfs /var/dir2ram/dir2ram_smart /var/lib/smartmontools log 21M/256M tmpfs /var/dir2ram/dir2ram_log /var/log monit 1M/8M tmpfs /var/dir2ram/dir2ram_monit /var/lib/monit spool 2M/32M tmpfs /var/dir2ram/dir2ram_spool /var/spool samba 1M/16M tmpfs /var/dir2ram/dir2ram_samba /var/cache/samba
oh just browsed fast through it, and it looks cool. This weekend will have a more through look into it. |
gave it a more through look. Is there a compelling reason for it to be written in perl? I'm not seeing anything that can't be done with shell scripts too, and I'd rather use shell scripts myself. |
Hi, For me shell scripts offer the maximum portability and comparability Programming languages on the other hand are very flexible, but often take Perl, as a scripting language is a good mix of both benefits. It has near Off the top of my head I used argument processing, hashes, functions, I read your GitHub 'Todo List' and I was able to implement nearly I was curious if there was any other features that should be added from Also, in the time between now and when I posted the version I made a few -Reed On Fri, Jan 22, 2016 at 3:38 AM, bobafetthotmail notifications@github.com
|
With all due respect because you clearly are a better programmer than me... I know shell (sh) is limited and I was already thinking about migrating, but I was looking mostly towards bash (which is similar to sh and I understand it decently, it is also the linux default CLI afaik). Bash can do the things you mentioned as perl advantages.
The ability to read/parse multiple config files. like most programs do, (like samba) with a /etc/folder2ram/config.d where the lines from the second file override the (same) lines from the first one. The ability to mount folders to disk, with the synching too. So you can move particular folders inside the RAID volume or data drives/whatever spinning drives. Also an option for ram drives to get a frequent synching of ram drives into data drives (either alone or in addition to synching to system drive), like for logs and stuff like that, you can have an option that synches to data drives every X minutes if there is enough write activity in the last X minutes to justify their use, otherwise don't sync and let the data drives go to sleep. I also wanted to experiment with a script that makes a squashfs of the folder, with a script run at boot that loads and keeps the squashfs in the ram.
I'm not going to accept Perl scripts in my repo, as I never really used it (yes I'm not kidding, don't look at me like that), and I don't have the time to learn how to use it decently, so I won't be able to maintain what you send. If you prefer keeping it in Perl, open your own repository, upload it there, maybe mention me in the credits or something, and become the lead developer. You already have a new name for your script lol. |
Hi, I didn't mean to put you on the defensive to defend Bash. I actually don't I did find a very interesting comparison of the two when you mentioned I would agree that I should create my own repo. I didn't want to take over Items you mentioned:
For example:
I just created a GitHub repository, with the latest version: I think before considering using it for the flashmemory plugin I'd like to As this is my first GitHub project, any help and advice is definitely -Reed On Sat, Jan 23, 2016 at 12:12 AM, bobafetthotmail notifications@github.com
|
Hi, Update about zRam. It is possible to use if you load the backported kernel It is actually a great solution, providing a mechanism to have read/write -Reed On Sat, Jan 23, 2016 at 10:56 AM, Reed Nelson reed.public@gmail.com wrote:
|
Closing this without merging for the reasons already discussed. I've answered (thoroughly) to your post in an issue I opened in your own new repo Reed97123/dir2ram#1 |
Hi,
Following on your good work, I've created a new version of folder2ram called dir2ram which extends the work to accomplish most of your todo list as well as fixing some of the bugs that I've experienced (long directory mangling, services needing to be stopped).
I was hoping you could give feedback on features and any bugs you encounter.
Summary:
Example Config file:
EXAMPLE:
Name FS MB LogHist Dependent_Service(s) Dir_To_Cache
smart tmpfs 8 5 smartd,smartmontools /var/lib/smartmontools
sickbeard tmpfs 256 5 sickbeard /var/opt/sickbeard
couch tmpfs 256 5 couchpotato /home/couchpotato
samba tmpfs 16 5 samba /var/cache/samba
ntp tmpfs 8 5 ntp /var/lib/ntp
minidlna tmpfs 16 5 minidlna /var/cache/minidlna
Covered by folder2ram:
log tmpfs 256 8 /var/log
vartmp tmpfs 512 5 /var/tmp
spool tmpfs 32 5 postfix /var/spool
rrd tmpfs 8 5 rrdcached /var/lib/openmediavault/rrd
rrdcached tmpfs 256 5 rrdcached /var/lib/rrdcached
monit tmpfs 8 5 monit /var/lib/monit
php tmpfs 8 5 php5-fpm /var/lib/php5
Example Status:
Name Space FileS Real Directory Mounted tmpfs|ramfs
==== ===== ===== ============== ===================
rrdcached 16M/256M tmpfs /var/dir2ram/dir2ram_rrdcached /var/lib/rrdcached
ntp 1M/8M tmpfs /var/dir2ram/dir2ram_ntp /var/lib/ntp
vartmp 0M/512M tmpfs /var/dir2ram/dir2ram_vartmp /var/tmp
rrd 1M/8M tmpfs /var/dir2ram/dir2ram_rrd /var/lib/openmediavault/rrd
php 1M/8M tmpfs /var/dir2ram/dir2ram_php /var/lib/php5
smart 0M/8M tmpfs /var/dir2ram/dir2ram_smart /var/lib/smartmontools
log 21M/256M tmpfs /var/dir2ram/dir2ram_log /var/log
monit 1M/8M tmpfs /var/dir2ram/dir2ram_monit /var/lib/monit
spool 2M/32M tmpfs /var/dir2ram/dir2ram_spool /var/spool
samba 1M/16M tmpfs /var/dir2ram/dir2ram_samba /var/cache/samba