ylogx / dotfiles

Fully automated dev environment setup with dotfiles
https://shubham.chaudhary.xyz/dotfiles
10 stars 2 forks source link

Setup a cron to backup important files like ~/.bash/zsh_history #18

Open ylogx opened 4 years ago

ylogx commented 4 years ago

Losing months of commands from ~/.zsh_history is not a fun thing.

Setup a cron to create backups in location that are autouploaded to cloud storage e.g. Google Drive folder.

jaymcgavren commented 2 years ago

After trying ln -s /Volumes/GoogleDrive/My\ Drive/shell/.zsh_history ~/.zsh_history (gets overwritten by zsh) and ln /Volumes/GoogleDrive/My\ Drive/shell/.zsh_history ~/.zsh_history (can't do a hard link across volumes) I landed here when Googling for a tested solution. Ah, well. 😛

Hopefully a simple 0 5 * * * cp /Users/jay/.zsh_history /Volumes/GoogleDrive/My\ Drive/shell/.zsh_history in my crontab will be effective.