Following is my crontab entry
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
* * * * * /FinalSync.sh $(date --date="5 days ago" +%d_%m_%Y) || echo $? >> log
Got no error in log file also
Shell Script
#! /bin/sh
source=/Source/$1
destination=/Destination
folderParam=$(basename $source)
if /usr/bin/rsync -avh -r $source $destination; then
cp /FolderCopyStatus/Success /Status/Success_$folderParam
else
cp /FolderCopyStatus/Failure /Status/Failure_$folderParam
fi
Script run perfectly when I use in command line as under
sh /FinalSync.sh $(date --date="5 days ago" +%d_%m_%Y)
printf
and similar functions. – terdon Oct 17 '16 at 11:00chmod +x FinalSyn.sh
. – Valentin B. Oct 17 '16 at 11:04126
error. – terdon Oct 17 '16 at 11:17