my task : tar up large bunch of files(about 10,000 files) in the current directories that created more than 30 days ago
but it come with following error
find ./ -ctime +30 | xargs tar rvf test1.tar
tar: test1.tar: A file or directory in the path name does not exist.
If the tar file does not exist you cannot update it!
So I would create the tar file first adding a single readme file describing what it contains, then do what you were going to do.
However, for sanities sake, use find to create the list of files, then you will have a record of what you were putting in the tar file, so if you need to move or delete them you can do so from that list.
Also, you don't want the tar file itself to be included.