When I run this command from php
sudo -u db2inst1 ls -t /var/lib/edumate/bdrs/*/*/daily/*NODE* | sort -r
I receive sudo: unable to execute /bin/ls: Argument list too long
ls lists all daily backup files we have for each customer. Customer has their directory under the bdrs
directory. So I guess the number of files got bigger than allowed because it used to work correctly.
Is there any way how to get list of all daily backup files using one shell command?
find
and-print0
? – jasonwryan Jul 18 '12 at 01:27sudo -u db2inst1 find /var/lib/edumate/bdrs/*/*/daily/*NODE* -type f -name '*' -print0| sort -r
? - this doesn't help. – Radek Jul 18 '12 at 01:36