backup website linux

Hello,
I normally backup my website by doing this

tar czf html.tar.gz html

I would like to know if its possible to ignore files *.jpg and *.avi

I am using centos.
LVL 1
XK8ERAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
santoshmotwaniConnect With a Mentor Commented:
--exclude=*.jpg --exclude=*.avi

at above command at the end of the command
0
 
skullnobrainsCommented:
don't want points, here, but quote or escape the * if you want to be on the safe side

if your tar version does not have the --exclude option as in many versions of gnutar, you can use find to generate the file list for tar
0
 
1ly4meCommented:
Also if you have list of files to exclude , you can use -X option.
Ex.
tar czf html.tar.gz -X exclude.txt html

Open in new window

0
All Courses

From novice to tech pro — start learning today.