Skip to content

Instantly share code, notes, and snippets.

@abiyasa
Last active August 29, 2015 14:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abiyasa/734083e51ec8111df272 to your computer and use it in GitHub Desktop.
Save abiyasa/734083e51ec8111df272 to your computer and use it in GitHub Desktop.
Script to backup a project folder to a 7Z file
#!/bin/bash
# Project to backup
PROJECT_NAME="myproject"
PROJECT_FOLDER="../works/myproject"
# Filename will be myproject-20150424.7z
NOW=$(date +"%Y%m%d")
FILE="$PROJECT_NAME-$NOW.7z"
# will backup all files expect the ones inside node_modules & .build folder
echo "Backing up to $FILE, please wait..."
7za a -t7z $FILE $PROJECT_FOLDER/. -xr\!node_modules -xr\!.build
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment