sethgoldin/davinci-resolve-postgresql-workflow-tools

Fallback destination directory

sethgoldin opened this issue · 0 comments

From @macvfx, a suggestion to check to make sure the folder exists:

#!/bin/bash

# The backup file path to check
file_path="/path/to/folder"

# Check if the file path exists and if we have write permissions on it
if [ -d "$file_path" ] && [ -w "$file_path" ]; then
  echo "The file path exists and we have write permissions on it. Do the regular backup step here"
else
  echo "The file path either does not exist or we do not have write permissions on it. Do the fail safe backup"
fi