To backup a specific filetype, e.g. all PHP files in the current directory and all subdirectories beneath it, you can use the following command:
tar -cvf example.tar $(find . -name "*.php")
The find command will find all of the PHP files and pass them to
the tar command. You can see that all of the PHP files are in the
tar backup file, example.tar with the command below:
tar -tvf example.tar
You can add HTML
files to the backup using the -u option for tar to update the
archive file as below:
tar -uvf example.tar $(find . -name "*.html")
References:
-
tar find ssh
May 2004
Computing.Net
