MEPIS Community Forum

A Linux operating system based on Debian Stable
View unanswered posts | View unsolved topics | View active topics |



Reply to topic  [ 26 posts ]  Go to page Previous  1, 2, 3  Next
I'm In Need of a Null Directory 
Author Message
Online
Administrator
User avatar

Joined: Wed Jul 12, 2006 2:17 pm
Posts: 10544
Location: Rochester NY
Has thanked: 804 times
Have thanks: 1362 times
Post # 298322
Post Re: I'm In Need of a Null Directory
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:
#!/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
Link to Wiki
Rich

Acer Laptop V5-572G: Intel i5, 12 GIG mem, nVidia GT720M/Intel integrated graphics
Mx-14 Symbiosis
Kubuntu 13.10, KDE 4.11.2


Fri Apr 06, 2012 9:29 am

richb thanked by: kmathern
Profile
Online
Administrator
User avatar

Joined: Wed Jul 12, 2006 2:17 pm
Posts: 10544
Location: Rochester NY
Has thanked: 804 times
Have thanks: 1362 times
Post # 298323
Post Re: I'm In Need of a Null Directory
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:
#!/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
Link to Wiki
Rich

Acer Laptop V5-572G: Intel i5, 12 GIG mem, nVidia GT720M/Intel integrated graphics
Mx-14 Symbiosis
Kubuntu 13.10, KDE 4.11.2


Fri Apr 06, 2012 9:45 am
Profile
MEPIS Enthusiast
MEPIS Enthusiast
User avatar

Joined: Mon Feb 12, 2007 1:45 pm
Posts: 5568
Location: Penn's Woods
Has thanked: 767 times
Have thanks: 620 times
Post # 298324
Post Re: I'm In Need of a Null Directory
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:
#!/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


Fri Apr 06, 2012 11:18 am
Profile
Online
MEPIS Enthusiast
MEPIS Enthusiast
User avatar

Joined: Wed Jul 12, 2006 2:26 pm
Posts: 6763
Has thanked: 367 times
Have thanks: 2143 times
Post # 298326
Post Re: I'm In Need of a Null Directory
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.


Fri Apr 06, 2012 11:47 am

kmathern thanked by: joany
Profile
MEPIS Enthusiast
MEPIS Enthusiast
User avatar

Joined: Mon Feb 12, 2007 1:45 pm
Posts: 5568
Location: Penn's Woods
Has thanked: 767 times
Have thanks: 620 times
Post # 298327
Post Re: I'm In Need of a Null Directory
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


Fri Apr 06, 2012 12:37 pm
Profile
MEPIS Guide
MEPIS Guide
User avatar

Joined: Sat May 16, 2009 3:59 pm
Posts: 2896
Has thanked: 414 times
Have thanks: 444 times
Post # 298328
Post Re: I'm In Need of a Null Directory
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, Radeon HD6570
Gigabyte A55M-DS2, AMD A4-3400 dual-core APU (llano), 2.7 GHz, Radeon HD graphics
IBM ThinkPad T43, Intel Pentium M, 1.73GHz, Intel chipset


Fri Apr 06, 2012 2:58 pm
Profile
MEPIS Enthusiast
MEPIS Enthusiast
User avatar

Joined: Mon Feb 12, 2007 1:45 pm
Posts: 5568
Location: Penn's Woods
Has thanked: 767 times
Have thanks: 620 times
Post # 298332
Post Re: I'm In Need of a Null Directory
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:
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


Fri Apr 06, 2012 3:51 pm
Profile
MEPIS Guide
MEPIS Guide
User avatar

Joined: Sat May 16, 2009 3:59 pm
Posts: 2896
Has thanked: 414 times
Have thanks: 444 times
Post # 298333
Post Re: I'm In Need of a Null Directory
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, Radeon HD6570
Gigabyte A55M-DS2, AMD A4-3400 dual-core APU (llano), 2.7 GHz, Radeon HD graphics
IBM ThinkPad T43, Intel Pentium M, 1.73GHz, Intel chipset


Fri Apr 06, 2012 4:04 pm
Profile
MEPIS Enthusiast
MEPIS Enthusiast
User avatar

Joined: Wed Jul 12, 2006 5:54 am
Posts: 10739
Location: Tulsa, Oklahoma U.S.A.
Has thanked: 3504 times
Have thanks: 847 times
Post # 298344
Post Re: I'm In Need of a Null Directory
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


Fri Apr 06, 2012 8:35 pm
Profile
MEPIS Guide
MEPIS Guide
User avatar

Joined: Sat May 16, 2009 3:59 pm
Posts: 2896
Has thanked: 414 times
Have thanks: 444 times
Post # 298348
Post Re: I'm In Need of a Null Directory
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, Radeon HD6570
Gigabyte A55M-DS2, AMD A4-3400 dual-core APU (llano), 2.7 GHz, Radeon HD graphics
IBM ThinkPad T43, Intel Pentium M, 1.73GHz, Intel chipset


Fri Apr 06, 2012 10:15 pm

DBeckett thanked by: lucky9
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 26 posts ]  Go to page Previous  1, 2, 3  Next

Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.