ylogx/dotfiles

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

ylogx opened this issue · 1 comments

ylogx commented

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.

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.