Claim your Biolink Click Here
1 like 0 dislike
21 views
in Education & Reference by (730 points)
edited by | 21 views

1 Answer

0 like 0 dislike

vi file.sh

#!/bin/bash

#Specify folders whose backup is to be taken in variables
DATE=`date +"%d_%b_%Y_%H%M"`
f1="/var/www/website.com"

#tar = Tape Archive tool for compression
#Creating same backup tar file for all specified folders
zip -r  /var/backup/file/website.com_${DATE}.zip $f1 

#Go to the backup folder location
cd /var/backup

#Show the size of the folder
du -sh

Cron

0 2 * * * /var/backup/file.sh
by (950 points)

Related questions

0 like 0 dislike
1 answer
1 like 0 dislike
1 answer
0 like 0 dislike
1 answer
1 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
1 like 0 dislike
1 answer
1 like 0 dislike
1 answer

Where your donation goes
Technology: We will utilize your donation for development, server maintenance and bandwidth management, etc for our site.

Employee and Projects: We have only 15 employees. They are involved in a wide sort of project works. Your valuable donation will definitely boost their work efficiency.

How can I earn points?
Awarded a Best Answer 10 points
Answer questions 10 points
Asking Question -20 points

1,268 questions
1,423 answers
568 comments
4,809 users