PDA

View Full Version : Clear memory cache on Linux


madness85
03-29-2014, 10:47 PM
I added this to my server http://hosting.com/support/linux/clear-memory-cache-on-linux-server/

I've removed everything above but getting emails every hour :( please help

--------------- Added 1396133446 at 1396133446 ---------------

Email

/bin/sh: /root/clearcache.sh: /bin/sh^M: bad interpreter: No such file or directory

I just want to remove it

kh99
03-29-2014, 11:25 PM
I think the ^M is a carriage return character, which windows uses at the end of lines in a text file but linux doesn't, so it's confused. To be honest I haven't used linux in a while, but I seem to remember a command called dos2unix which would fix that (assuming you don't know how to use vi or another linux editor). Try the command:
dos2unix /root/clearcache.sh


If you still want to remove the fix, try crontab -e and remove the line you added.

Edit: Oh, I see you said you removed everything that that page says to add? If that's the case then I don't know. Maybe emails are queued up somewhere or something like that, because it doesn't seem possible to get that message if you removed /root/clearcache.sh

snakes1100
03-30-2014, 05:56 AM
chk crontab
crontab -e

Zachery
03-30-2014, 07:04 AM
You should really let your OS manage its memory. It knows how to operate more efficiently than you do.