/bin/cp: Argument list too long
Michael J McCafferty
mike at m5computersecurity.com
Wed Dec 1 16:13:25 EST 2004
It seems to me that this is already in Nessus version 2.2.0.
What version are you using ?
I am not an expert at this, and I am sure I am wrong somehow, but:
'find' is kind of slow, and I think the code below will eventually suffer the
same
problem. As I understand it, this code will run the find command and use the
output from find as the argument for the cp command. So, it will still
eventually result in the same "Argument too long". The code listed below just
chops it into two groups of file names, *.inc and *.nasl
perhaps xargs would do better since it will build as few commands and needed to
do the trick. Perhaps something like this:
ls -1 . | xargs -i cp \{\} "$pluginsdir/"
Quoting Clyde Hoadley <hoadleyc at mscd.edu>:
> I have a cron job that runs nessus-update-plugins
> every morning. It has been failing the past several
> days (not quite a week now) with the following error.
> "./nessus-update-plugins: /bin/cp: Argument list too long"
>
> I concluded that the problem was caused by there being
> more files in the source directory than the Linux copy
> command could handle. I was able to kludge a temporary
> work around. I'm sure there is a better way to fix the
> problem but this is how I fixed my problem.
>
> I edited my local copy of nessus-update-plugins and
> changed it as follows (at, or about line 245):
>
> # cp -p *.nasl "$pluginsdir/"
> find . -name '*.nasl' -exec cp -p {} "$pluginsdir/" \; >> /tmp/stuff
> #cp -p *.inc "$pluginsdir/"
> find . -name '*.inc' -exec cp -p {} "$pluginsdir/" \; >> /tmp/stuff
>
> It appears to be working again.
>
> --
> Clyde Hoadley
> Metropolitan State College of Denver
> http://clem.mscd.edu/%7Ehoadleyc/
> hoadleyc at mscd.edu
>
>
> _______________________________________________
> Nessus mailing list
> Nessus at list.nessus.org
> http://mail.nessus.org/mailman/listinfo/nessus
>
--
************************************************************
Michael J. McCafferty
Principal, Security Engineer
M5 Hosting
858-576-7325 Voice
http://www.m5hosting.com
************************************************************
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
More information about the Nessus
mailing list