I want to run this command:
free && sync && echo 3 > /proc/sys/vm/drop_caches && free -m
by cron. That way I can free my RAM and cache in an Ubuntu system.
I'm using these steps:
# crontab -e 2 * * * * my_user_name /usr/bin/free free && sync && echo 3 > /proc/sys/vm/drop_$
save & exit
# service cron restart
But, when I run free -m
nothing changes.
For reference, it looks something like this:
# free -m
total used free shared buffers cached
Mem: 7976 5064 2911 5 169 3478
-/+ buffers/cache: 1416 6560
Swap: 8112 1264 6848
approachit
? – neuron Aug 12 '15 at 06:52service cron restart
aftercrontab -e
.crontab -e
will automatically notifycron
that something has changed. If you found the crontab file, and manually went to it and edited it, you would need to do something to tellcron
to reread the modified file (so *don't do that* — just usecrontab -e
). – G-Man Says 'Reinstate Monica' Oct 16 '15 at 05:02