#!/bin/sh ####################################################################### #Script Name: get_files1_services.sh #Version: 1.1 #Description: Downloading DA files to server #Last Modify Date: 05072021 #Author:Brent Dacus #Email:brent[at]thedacus[dot]net ####################################################################### server=files1.directadmin.com localloc=/home/admin/domains/delaintech.com/public_html/files/services excfile=/home/admin/domains/delaintech.com/public_html/files/service.txt q="-q" if [ $# -gt 0 ]; then q="-v --stats --progress" fi lock=$0.lock if [ -e $lock ]; then echo "$0: cannot rsync due to lock: $lock"; echo "current time: $(date)" ls -la $lock exit 1 fi trap_ctrlc () { echo "Ctrl-C caught...performing clean up" rm -f $lock exit 2 } trap "trap_ctrlc" 2 touch $lock /usr/local/bin/rsync $q --exclude-from=${excfile} --recursive --perms --links --delete --times -W ${server}::files ${localloc} chown -R admin:admin ${localloc} rm -f $lock exit 0;