I have a bash script for deploying code from a beta environment to a production environment but currently I have to add the list of files to a txt file manaully and sometime I miss some. Basically my deployment script cat/loops copying the files over. (exports/imports db as well but that's not relevant..lol)
Anyway, I'd like to use the find
command to generate a list of files modified in the last 14 days. The problem is I need to strip the path out ./
in order for the deployment script to work.
Here's an example of the find command usage:
find . -type f -mtime -14 > deploy.txt
Here's the line that cats deploy.txt
in my deployment script:
for i in `cat deploy.txt`; do cp -i /home/user/beta/public_html/$i /home/user/public_html/$i; done
Any idea how to accomplish this using bash scripting?
Thanks!