Created
April 19, 2017 15:55
-
-
Save neeltom92/2fea5abfc441c90c174334b0e4bf06c9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
n=domain_name; | |
#REPLACE HERE WITH THE DOMAIN NAME | |
dn=(/scripts/whoowns $n) | |
cd /home/$dn/public_html; | |
archive_directory="/home/$dn/public_html/archive" | |
if [ -d $archive ] | |
then | |
rm -f archive.tar.gz | |
else | |
mkdir archive | |
fi | |
find . -mtime -1 -type -f -print0 | xargs -0 tar -rvf "$archive.tar"; | |
gzip $archive.tar | |
# set it in a cron as below | |
#*0*** location dev/null | |
exit 0 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment