Skip to content

Instantly share code, notes, and snippets.

@gautamkrishnar
Created June 21, 2015 14:31
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 gautamkrishnar/1132346d4372d91de255 to your computer and use it in GitHub Desktop.
Save gautamkrishnar/1132346d4372d91de255 to your computer and use it in GitHub Desktop.
Backup your website directory (Linux Shell Script) in a folder with foldername as current time in the backup folder
d="$(date -d -now)"
mkdir backup/"$d"
cp -r /var/www/html/* backup/"$d"
@gautamkrishnar
Copy link
Author

Put the script in the folder you need to store backup
First make the backup folder by typing:
mkdir backup
Then execute the script:
bash backup.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment