1 |
> way around "Argument list too long"?: |
2 |
> |
3 |
>> My crontab deletes all files of a certain type in a certain folder |
4 |
>> with yesterday's date in the filename. It usually executes but |
5 |
>> sometimes fails with: |
6 |
>> |
7 |
>> /bin/rm: Argument list too long |
8 |
>> |
9 |
>> What would you do about this? |
10 |
> |
11 |
> Use find with the -delete option. |
12 |
|
13 |
I'm getting the same thing from find: |
14 |
|
15 |
$ /usr/bin/find /home/user/*-`/bin/date -d 'yesterday' +\%Y\%m\%d`*.jpg |
16 |
/usr/bin/find: Argument list too long |
17 |
|
18 |
$ /usr/bin/find -delete /home/user/*-`/bin/date -d 'yesterday' +\%Y\%m\%d`*.jpg |
19 |
/usr/bin/find: Argument list too long |
20 |
|
21 |
$ /usr/bin/find /home/user/*-`/bin/date -d 'yesterday' +\%Y\%m\%d`*.jpg|xargs rm |
22 |
/usr/bin/find: Argument list too long |
23 |
rm: missing operand |
24 |
Try `rm --help' for more information. |
25 |
|
26 |
- Grant |