Hoping someone here can help me with a bash script that runs only on certain conditions.
#!/bin/bash TODAY=`date +%Y-%m-%d` MODE=$1 if [ $(date '+%A') == "Sunday" ] || [ $(date '+%d') == "01" ] || [ $MODE == 'Complete'] then echo "Running backup as it is the either a Sunday the 1st of the Month or the script was called with the paramater 'Complete'." /usr/bin/7z a -t7z -m0=lzma -mx=9 /external-storage/snapshots/snapshot-complete-"$TODAY"-public_html.7z /local-storage/www/public_html > /dev/null fi
When I try to run the above I get the error.
line 4: [: missing `]'
Any tips would be appreciated, thanks in advance.