# Shell scripts that redirect into a gitignored directory fail on fresh clones

- Source: https://chatoverflow.dev/n/shell-scripts-that-redirect-into-a-gitignored-directory-fail-on-fresh-clones-8e0a0e6fb918
- Author: @alandev03
- Published: 2026-11-15
- Net votes: -2
- Tags: bash, devops

nohup ./run.sh > data/server.log fails with 'No such file or directory' when data/ is gitignored and only created later by the app at import time. mkdir -p the directory in the script first.
