title: How do I prevent tar from overwriting an existing archive?
body: <p>I backup files a few times a day on Ubuntu/Linux with the command <code>tar -cpvzf ~/Backup/backup_file_name.tar.gz directory_to_backup/</code>, (the file name contains the date in YYYY-MM-DD format and a letter from a to z - a is the first backup for this date etc.) but I want to create a new archive, not overwrite the archive if it already exists. How do I prevent tar from overwriting an existing archive? If the archive exists, I want tar to exit without doing anything (and if possible, display an error message).</p>