> way around "Argument list too long"?: > >> My crontab deletes all files of a certain type in a certain folder >> with yesterday's date in the filename. It usually executes but >> sometimes fails with: >> >> /bin/rm: Argument list too long >> >> What would you do about this? > > Use find with the -delete option.
I'm getting the same thing from find: $ /usr/bin/find /home/user/*-`/bin/date -d 'yesterday' +\%Y\%m\%d`*.jpg /usr/bin/find: Argument list too long $ /usr/bin/find -delete /home/user/*-`/bin/date -d 'yesterday' +\%Y\%m\%d`*.jpg /usr/bin/find: Argument list too long $ /usr/bin/find /home/user/*-`/bin/date -d 'yesterday' +\%Y\%m\%d`*.jpg|xargs rm /usr/bin/find: Argument list too long rm: missing operand Try `rm --help' for more information. - Grant