Magento - session files are not deleted automatically - debian or Ubuntu

If you are on debian or Ubuntu server and your Magento site is configured to save sessions on file system, there is possibility that the session files are not getting deleted automatically.
Actually, the session files should be deleted automatically according to PHP settings 

session.gc_probability = 1
session.gc_divisor = 1000

; After this number of seconds, stored data will be seen as 'garbage' and
; cleaned up by the garbage collection process.
session.gc_maxlifetime = 1440

But on debian or Ubuntu it does not delete the session files inside /var/session directory. And, after some weeks you'd fine thousands of files in the /var/session directory.

So, the workaround could be as below.

Create a shell script file ( on your server with below two lines of code.

find /MAGENTO_ROOT/var/session -name 'sess_*' -type f -mtime +2 -exec rm {} \;

The MAGENTO_ROOT and +2 should be adjusted. 
MAGENTO_ROOT is the path to your Magento site installation and +2 indicates the last number of days the session files should be kept. In this case the session files created before 2 days will be deleted. So, there would be files created on today, yesterday and the day before yesterday.

Now, to execute the shell script over the time, add a cron entry.

So, the session files cleanup script will run everyday at 3 am.