Skip to content

Instantly share code, notes, and snippets.

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 neeltom92/2fea5abfc441c90c174334b0e4bf06c9 to your computer and use it in GitHub Desktop.
Save neeltom92/2fea5abfc441c90c174334b0e4bf06c9 to your computer and use it in GitHub Desktop.
#!/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