- It copies the .bash_profile from an original location to your desired destination.
cp /PATH-TO-YOUR-PROFILE/.bash_profile /BACKUP-DESTINATION/macOS-.bash_profile-backup - Then we enter your backup destination.
cd /BACKUP-DESTINATION/macOS-.bash_profile-backup - With
git add .we add all files into the GitHub repository. - We commit all files with comment from script execution time:
"generated files on date +'%Y-%m-%d %H:%M:%S'";git commit -a -m "generated files on date +'%Y-%m-%d %H:%M:%S'"; - And at the very end we push to GitHub.
git push origin master
wojciehm/macOS-.bash_profile-cron-backup
This short script allows you to backup your .bash_profile and run it as cron job
ShellMIT
