I created the file ~/scripts/tar.sh
:
#!/bin/bash
if [ -f $1 ]; then
echo "Oops! backup file was already here."
exit
fi
tar -cpvzf $1 $2 $3 $4 $5
Now I just have to type:
~/scripts/tar.sh ~/Backup/backup_file_name_`date +"%Y-%m-%d"`_a.tar.gz directory_to_backup/
And the backup file is created if the file doesn't exist.