The */1
is the same as *
in the cron definition so
0 * * * * ...
would work the same way.
In find the -delete
will delete the files as you request but it may not be what you want. You can test your find command by running it from the command line without the -delete
option
find /tmp/ -name "Sess_*"
which will give you the list of files that would be acted upon.
Better still might be to look at the /etc/cron.d/php5 file which does the same thing for session files located in /var/lib/php5. Note that it only deletes files that are older than the system's maxlifetime by using the -cmin option ...
# /etc/cron.d/php5: crontab fragment for php5
# This purges session files older than X, where X is defined in seconds
# as the largest value of session.gc_maxlifetime from all your php.ini
# files, or 24 minutes if not defined. See /usr/lib/php5/maxlifetime
# Look for and purge old sessions every 30 minutes
09,39 * * * * root [ -x /usr/lib/php5/maxlifetime ] && [ -d /var/lib/php5 ] && find /var/lib/php5/ -depth -mindepth 1 -maxdepth 1 -type f -cmin +$(/usr/lib/php5/maxlifetime) ! -execdir fuser -s {} 2>/dev/null \; -delete
By doing it this way you won't blindly delete session files that are in use.