Skip to content

Instantly share code, notes, and snippets.

@mrrcollins
Last active May 31, 2020 02:00
Show Gist options
  • Save mrrcollins/185ef0c88bc715abfa48f5d45a528403 to your computer and use it in GitHub Desktop.
Save mrrcollins/185ef0c88bc715abfa48f5d45a528403 to your computer and use it in GitHub Desktop.
#!/bin/bash
#Get the date
#echo "Remembering what day it is."
#UPDATE=$(date +"%Y%m%d")
#date=$(date)
#Get The Day of the Week
DAYOFWEEK=$(date +"%u")
#Account for Weekend
if [ "${DAYOFWEEK}" -eq 1 ]; then
YESTERDAY=$(date -v-3d +"%m-%d-%Y")
YESTERDAYFOX=$(date -v-3d "-3 days" +"%m-%d-%Y")
else
YESTERDAY=$(date -v-1d +"%m-%d-%Y")
YESTERDAYFOX=$(date -v-1d +"%m-%d-%Y")
fi
echo "The day of the week is $DAYOFWEEK"
echo "Yesterday was $YESTERDAY"
if [ $DAYOFWEEK = "5" ]; then
TOMORROW=$(date -v-3d +"%m-%d-%Y")
else
TOMORROW=$(date -v-3d +%m-%d-%Y"")
# From Stack - yesterday=$(date -d "$date -1 days" +"%Y%m%d")
FOX=$(date +"%m-%d-%Y")
#echo date
#Start the copy
echo "Copying"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment