Tags

, ,


Need to make changes to your web site?

Prior to making the changes, save a copy of the site into a tar file with time and date info.

 

#!/bin/bash
#
# Sid Young 2014
#
# Tar up required files and save in a tar file that is date and time stamped
# then display the archive back to see that its all there
#
#
ARCHIVE=`date '+%Y-%m-%d-%H%M'`
/bin/tar -cvf web-site-${ARCHIVE}.tar *.{php,js}
echo " "
echo " "
echo "Archive contains the following files:"
echo "===================================== "
#
# output table from tar file
#
/bin/tar -tf web-site-${ARCHIVE}.tar

 

Script Output

When run the script will generates the following output:

Archive contains the following files:
=====================================
cnx-bws-account.php
cnx-bws-domain-entry.php
cnx-bws-footer.php
cnx-bws-header.php
cnx-bws-login.php
cnx-bws-payments.php
cnx-bws-setup-block-end.php
cnx-bws-setup-block-start.php
cnx-countries.php
ConetixWebStarter.php
phpinfo.php
conetix.js

Directory Listing

-rw-r--r-- 1 root root 51200 Apr 22 11:43 web-site-2014-04-22-1143.tar
-rw-r--r-- 1 root root 51200 Apr 24 13:59 web-site-2014-04-24-1359.tar
-rw-r--r-- 1 root root 51200 May 5 14:48 web-site-2014-05-05-1448.tar
-rw-r--r-- 1 root root 51200 May 6 14:24 web-site-2014-05-06-1424.tar
-rw-r--r-- 1 root root 51200 May 6 15:43 web-site-2014-05-06-1543.tar
-rw-r--r-- 1 root root 51200 May 8 09:54 web-site-2014-05-08-0954.tar

Enjoy!

-oOo-

Advertisements