I'm In Need of a Null Directory

Here is where users who have been using MEPIS awhile and know the basics of linux and MEPIS can ask questions.
Message
Author
User avatar
richb
Administrator
Posts: 13017
Joined: Wed Jul 12, 2006 2:17 pm

Re: I'm In Need of a Null Directory

#11 Postby richb » Fri Apr 06, 2012 9:29 am

kmathern wrote:You might create a simple script to remove files in the ~/.thumbnails/large & ~/.thumbnails/normal directories (like the one below) and have it run as a cron job at whatever interval you want (daily, hourly, every 15 minutes, etc).

Code: Select all

#!/bin/bash

rm  ~/.thumbnails/large/*
rm  ~/.thumbnails/normal/*


I don't have that much experience in setting up cron jobs but it doesn't look too difficult. I found one guide here: http://www.cyberciti.biz/faq/how-do-i-a ... unix-oses/. Btw, is there a KDE4 program for creating/managing cron jobs?

kde-config-cron

It shows as Task scheduler in System Settings.
Forum Rules
Guide - How to Ask for Help

Rich

Laptop: Acer V5-572G: Intel i5, 12 GIG mem, Intel graphics, SanDisk SSD, 256GB
Virtualbox: Win 7
Desktop: MX-15- 64, AMD A8 7600 FM2+ CPU R7 Graphics, fglrx driver, 16 GIG Mem. Samsung EVO SSD 250 GB

User avatar
richb
Administrator
Posts: 13017
Joined: Wed Jul 12, 2006 2:17 pm

Re: I'm In Need of a Null Directory

#12 Postby richb » Fri Apr 06, 2012 9:45 am

kmathern wrote:You might create a simple script to remove files in the ~/.thumbnails/large & ~/.thumbnails/normal directories (like the one below) and have it run as a cron job at whatever interval you want (daily, hourly, every 15 minutes, etc).

Code: Select all

#!/bin/bash

rm  ~/.thumbnails/large/*
rm  ~/.thumbnails/normal/*


I don't have that much experience in setting up cron jobs but it doesn't look too difficult. I found one guide here: http://www.cyberciti.biz/faq/how-do-i-a ... unix-oses/. Btw, is there a KDE4 program for creating/managing cron jobs?

I used the task scheduler to add the two cron jobs you referenced to run at bootup. You can also set it to run daily at any particular time, or on any particular day of the week, month or year. It is quite a useful application.
Forum Rules
Guide - How to Ask for Help

Rich

Laptop: Acer V5-572G: Intel i5, 12 GIG mem, Intel graphics, SanDisk SSD, 256GB
Virtualbox: Win 7
Desktop: MX-15- 64, AMD A8 7600 FM2+ CPU R7 Graphics, fglrx driver, 16 GIG Mem. Samsung EVO SSD 250 GB

User avatar
joany
Forum Veteran
Forum Veteran
Posts: 6112
Joined: Mon Feb 12, 2007 1:45 pm

Re: I'm In Need of a Null Directory

#13 Postby joany » Fri Apr 06, 2012 11:18 am

kmathern wrote:You might create a simple script to remove files in the ~/.thumbnails/large & ~/.thumbnails/normal directories (like the one below) and have it run as a cron job at whatever interval you want (daily, hourly, every 15 minutes, etc).

Code: Select all

#!/bin/bash

rm  ~/.thumbnails/large/*
rm  ~/.thumbnails/normal/*


I don't have that much experience in setting up cron jobs but it doesn't look too difficult. I found one guide here: http://www.cyberciti.biz/faq/how-do-i-a ... unix-oses/. Btw, is there a KDE4 program for creating/managing cron jobs?

Actually, I did this prior to experimenting with /dev/null. I used the System Settings > Task Manager to schedule the job. The shell script ran properly when I executed it manually, but when I set it up as a chon job, it failed to clear out ~/.thumbnails/normal.
MX-14; 3.12-0.bpo.1-686-pae kernel using 4GB RAM
2.4GHz AMD Athlon 4600+
NVidia GeForce 6150 LE; 304.121 Display Driver
You didn't slow down because you're old; you're old because you slowed down.

User avatar
kmathern
Forum Veteran
Forum Veteran
Posts: 8985
Age: 58
Joined: Wed Jul 12, 2006 2:26 pm

Re: I'm In Need of a Null Directory

#14 Postby kmathern » Fri Apr 06, 2012 11:47 am

joany wrote:Actually, I did this prior to experimenting with /dev/null. I used the System Settings > Task Manager to schedule the job. The shell script ran properly when I executed it manually, but when I set it up as a chon job, it failed to clear out ~/.thumbnails/normal.


I don't know about M8.5/KDE 4.3, but with the KDE 4.7.4 Task Scheduler I found I didn't need the script I posted earlier. I just pasted in the command I wanted to have run and created the schedule for it. I changed the command to rm ~/.thumbnails/*/*. The cron job seems to be working okay for me in removing the files in both the ~/.thumbnails/large & ~/.thumbnails/normal directories.

User avatar
joany
Forum Veteran
Forum Veteran
Posts: 6112
Joined: Mon Feb 12, 2007 1:45 pm

Re: I'm In Need of a Null Directory

#15 Postby joany » Fri Apr 06, 2012 12:37 pm

kmathern wrote:
joany wrote:Actually, I did this prior to experimenting with /dev/null. I used the System Settings > Task Manager to schedule the job. The shell script ran properly when I executed it manually, but when I set it up as a chon job, it failed to clear out ~/.thumbnails/normal.


I don't know about M8.5/KDE 4.3, but with the KDE 4.7.4 Task Scheduler I found you don't need the script I posted earlier. You can just paste in the command you want run and create the schedule for running it {I changed the command to rm ~/.thumbnails/*/* }. The cron job seems to be working okay for me in removing the files in both the ~/.thumbnails/large & ~/.thumbnails/normal directories.

Thanks. I'll try your variation of using the wild card in the rm command in place of listing the directory names. It seems that including two different tasks in one shell script running as a cron job doesn't work for some reason.
MX-14; 3.12-0.bpo.1-686-pae kernel using 4GB RAM
2.4GHz AMD Athlon 4600+
NVidia GeForce 6150 LE; 304.121 Display Driver
You didn't slow down because you're old; you're old because you slowed down.

User avatar
DBeckett
Forum Veteran
Forum Veteran
Posts: 3065
Joined: Sat May 16, 2009 3:59 pm

Re: I'm In Need of a Null Directory

#16 Postby DBeckett » Fri Apr 06, 2012 2:58 pm

joany wrote:It seems that including two different tasks in one shell script running as a cron job doesn't work for some reason.

Hmm, I don't know why that would be. I use cron jobs often to run fairly complicated scripts containing multiple commands.
Gigabyte 990FXA-UD3, AMD FX-6100 hex-core, 3.3GHz, 8G, Radeon HD6570

User avatar
joany
Forum Veteran
Forum Veteran
Posts: 6112
Joined: Mon Feb 12, 2007 1:45 pm

Re: I'm In Need of a Null Directory

#17 Postby joany » Fri Apr 06, 2012 3:51 pm

DBeckett wrote:
joany wrote:It seems that including two different tasks in one shell script running as a cron job doesn't work for some reason.

Hmm, I don't know why that would be. I use cron jobs often to run fairly complicated scripts containing multiple commands.

I don't know either, but when my original shell script ran as a cron job, it would clear ~/.thumbnails/large (1st task) but it failed to clear ~/.thumbnails/normal (2nd task). Strangely enough, when I ran the shell script manually, it would complete both tasks without a problem. :confused:

UPDATE:

I followed kmathern's suggestion of using the task scheduler to run a command directly every 15 minutes:

Code: Select all

rm -fr /home/username/.thumbnails/*/*


This does clear both sub-directories every 15 minutes. :yay: BTW, I think adding the option "-fr" (force, recursive) helps.

So I don't have to mess around with /dev/null after all. I'm marking this thread "Solved" even though I ended up using a different method entirely.
MX-14; 3.12-0.bpo.1-686-pae kernel using 4GB RAM
2.4GHz AMD Athlon 4600+
NVidia GeForce 6150 LE; 304.121 Display Driver
You didn't slow down because you're old; you're old because you slowed down.

User avatar
DBeckett
Forum Veteran
Forum Veteran
Posts: 3065
Joined: Sat May 16, 2009 3:59 pm

Re: I'm In Need of a Null Directory

#18 Postby DBeckett » Fri Apr 06, 2012 4:04 pm

joany wrote:So I don't have to mess around with /dev/null after all. I'm marking this thread "Solved" even though I ended up using a different method entirely.

Cool. Although it's not as dead-easy as kmathern's solution, another more complicated option would have been to use a ramdisk, assuming you reboot periodically and can spare ~100MB of RAM. I just set one up, linked to .thumbnails, and it works nicely.
Gigabyte 990FXA-UD3, AMD FX-6100 hex-core, 3.3GHz, 8G, Radeon HD6570

User avatar
lucky9
Forum Veteran
Forum Veteran
Posts: 12338
Joined: Wed Jul 12, 2006 5:54 am

Re: I'm In Need of a Null Directory

#19 Postby lucky9 » Fri Apr 06, 2012 8:35 pm

What kind of increase in speed did you see? With the RAM disk that is.
Yes, even I am dishonest. Not in many ways, but in some. Forty-one, I think it is.
--Mark Twain

User avatar
DBeckett
Forum Veteran
Forum Veteran
Posts: 3065
Joined: Sat May 16, 2009 3:59 pm

Re: I'm In Need of a Null Directory

#20 Postby DBeckett » Fri Apr 06, 2012 10:15 pm

lucky9 wrote:What kind of increase in speed did you see? With the RAM disk that is.

Surprisingly, not that much, but I didn't really explore it that much before I quit fooling with it. In a split Dolphin I opened some folders of photos and then watched as it (and the .thumbnails folder)) became populated with thumbnails. I didn't notice any difference really.
Gigabyte 990FXA-UD3, AMD FX-6100 hex-core, 3.3GHz, 8G, Radeon HD6570


Return to “Regulars”

Who is online

Users browsing this forum: No registered users and 3 guests