How to clear the cache via a command line/cron

It seems that the sitemap read by Google contains only a small percentage of my store’s links. When I clear the cache (&cc) and resubmit the sitemap, all the links are submitted. I have to do this at least monthly. Is there a command line I can use in cron which will clear the cache?

rm -r /var/{cache,compiled};

Thanks tbirnseth,



As always, you are wealth of information.

[color=#282828][font=arial, verdana, tahoma, sans-serif]Hi[/font][/color]



[color=#282828][font=arial, verdana, tahoma, sans-serif]Thank you for posting the information on clearing the cahce via a cron task.[/font][/color]



[color=#282828][font=arial, verdana, tahoma, sans-serif]Is this command:[/font][/color]



[color=#282828][font=arial, verdana, tahoma, sans-serif]rm -r /var/{cache,compiled}; [/font][/color]



[color=#282828][font=arial, verdana, tahoma, sans-serif]still compatible with v4.0.3?[/font][/color]



[color=#282828][font=arial, verdana, tahoma, sans-serif]Thank you for your help with this.[/font][/color]



[color=#282828][font=arial, verdana, tahoma, sans-serif]With best wishes[/font][/color]



[color=#282828][font=arial, verdana, tahoma, sans-serif]Charles[/font][/color]

[quote]

[color=#282828][font=arial, verdana, tahoma, sans-serif]Is this command:[/font][/color]

[color=#282828][font=arial, verdana, tahoma, sans-serif]rm -r /var/{cache,compiled}; [/font][/color]

[color=#282828][font=arial, verdana, tahoma, sans-serif]still compatible with v4.0.3?[/font][/color]

[/quote]

For V4, to completely remove all cached data from the system you should use:

```php

cd [root of your store]

rm -r var/cache/{misc,registry,templates}

```



But it is always best to just use command parameters in your admin panel since these will adjust for changes in newer versions. I.e.


[your_domain_admin.php]?cc&ctpl

That's great - I ran the command as a cronjob, and it worked perfectly for resetting cached content.



Thanks again!