#!/bin/bash # Set backup location here bak=$1 timestamp=$(date +%F_%T%z) # Make a timestamped directory there. mkdir -v "$bak"homeprofile_backup_"$timestamp" # Make what has been bade by mkdir and put that into a variable. timedir="$bak"homeprofile_backup_"$timestamp"/ # For this, blaah.txt has to exist in your directory, that one is supposed to get copied over. rsync -avp --partial --progress --human-readable --relative blaah.txt "$timedir"