zsh_notes
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
zsh_notes [2023/01/03 21:15] – [Change the default shell] raju | zsh_notes [2023/01/26 21:27] (current) – raju | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ===== Sample scripts ===== | ||
+ | |||
+ | ==== backup a directory ==== | ||
+ | The idea here is to cd into a given directory and then backup a directory in it. The path names are hard coded to make things simple. | ||
+ | < | ||
+ | #! / | ||
+ | set -e | ||
+ | topdir=/ | ||
+ | bdir=projects | ||
+ | |||
+ | cd ${topdir} | ||
+ | |||
+ | asof=`date +' | ||
+ | ofile=${bdir}_${asof}.txz | ||
+ | tar cJf ${ofile} ${bdir} | ||
+ | if [ $? -eq 0 ]; then | ||
+ | printf " | ||
+ | fi | ||
+ | </ | ||
+ | |||
+ | Sample run: | ||
+ | < | ||
+ | % ~/ | ||
+ | backup stored in: / | ||
+ | </ | ||
+ | |||
===== To be sorted ===== | ===== To be sorted ===== | ||
zsh_notes.1672780552.txt.gz · Last modified: 2023/01/03 21:15 by raju