Created
April 30, 2013 09:26
-
-
Save willtonkin/5487619 to your computer and use it in GitHub Desktop.
E-mail file, copy it with the current date appended to the filename and empty the file contents.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
FILE=targetfile.txt | |
echo "Email body text goes here" | mutt -a "$FILE" -s "Email subject goes here" -- [email protected] | |
TIMESTAMP=`date +%Y%m%d` | |
NEW_FILE=$FILE.$TIMESTAMP | |
cp $FILE $NEW_FILE | |
/dev/null > $FILE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment