Arg list too long error while performing tar and zip operation

hi all
i am trying to tar and then zip files present dir by using the below command

tar -cvf ${abc}/xyz_backup_date_`date +%d%m%y%H%M%S`.tar  xyz*

when the files are in less number the above command executes perfectly but when there are large number of files i am getting "arg list too long" error

please suggest on this error

If your tar supports -T / --files-from :

ls xyz* | tar --files-from=- --create --file ${abc}/backup_file.tar

...or short...

ls xyz* | tar -cT - -f ${abc}/backup_file.tar

See: Linux Manpages Online - man.cx manual pages

My tar don't support -T

Check your local tar man-page if tar supports to read file names from stdin.
Another option is cpio - a similar tool - which I'm quite sure it supports reading file names from stdin on your system too, even if i don't know the name and version yet.

If you tell us about specific versions information about your os and your tar command, somebody here may give more information.

Cramming too many arguments into ls doesn't stop them from being too many arguments. When this happens you have to give up shell globbing.

rm -f backup_file.tar
ls | grep "^xyz" | xargs tar -rcf backup_file.tar
gzip backup_file.tar

xargs will run tar several times, as many as needed, to append every file to the tarball. (This is why there's an rm -- so that if you run it twice, it will start over instead of making the existing tarball bigger.)

This is less efficient than -T or cpio, especially in that it can't compress the tarball until after it's finished. But if those aren't options, this is how you can do it.

Um. What did I smoke to write such nonsense? Sorry.