[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 331
  • Last Modified:

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.
0
XK8ER
Asked:
XK8ER
1 Solution
 
santoshmotwaniCommented:
--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

Featured Post

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now