Skip to content

Instantly share code, notes, and snippets.

@zodiac1111
Created August 22, 2014 05:14
Show Gist options
  • Save zodiac1111/09326228b57e4e095f73 to your computer and use it in GitHub Desktop.
Save zodiac1111/09326228b57e4e095f73 to your computer and use it in GitHub Desktop.
tar 压缩,排除文件,目录,符号连接,指定用户
# --numeric-owner:指定解压出来的文件所有者为root,因为目标为root(0)用于
tar --exclude="$(DIST_PAGKE)" --exclude=".svn" --exclude=".git" \
--exclude="etc" \
--exclude="data/config" \
--exclude="*.log" \
--exclude="scss" \
--exclude=".project" --exclude=".gitignore" --exclude=".cproject" \
-hczf $(DIST_PAGKE) -C $(DIST_DIR) . \
--numeric-owner --owner=0 --group=0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment