-refresh() {
-
- read -p "Are you sure you want to refresh? [y/n] " ask
- [ "$ask" != "y" ] && echo "Aborting..." && exit 0
-
- # delete everything between tokens (remove dupe code)
- echo -e "$blog_index_file\n$rolling_file\n$rss_file" | xargs sed -i "/<!-- BLOG START -->/,/<!-- BLOG END -->/{/<!-- BLOG START -->/!{/<!-- BLOG END -->/!d}}"
-
- # deletes all html files and republishes all published files
- echo "Successfully refreshed."
+backup() {
+ backup_name=`mktemp --tmpdir="$data_dir/backups" -d "backup_$(date +'%b-%d')_XXX"`
+ echo "Creating backup, will be placed in $backup_name"
+ cp -r "$data_dir/drafts/" "$backup_name"
+ cp -r "$data_dir/published/" "$backup_name"