Create backup.sh
This commit is contained in:
parent
587fd512ea
commit
ec0dfca06d
1 changed files with 14 additions and 0 deletions
14
backup.sh
Normal file
14
backup.sh
Normal file
|
@ -0,0 +1,14 @@
|
|||
#!/bin/csh
|
||||
#Script to grab all relevant configuration files and installed packages, and back it up to github
|
||||
/usr/sbin/pkg prime-origins > /root/fw/pkg_prime-origins
|
||||
|
||||
foreach i ( "/boot/loader.conf" "/etc/pf.conf" "/etc/rc.conf" "/etc/start_if.igb0" "/usr/local/etc/dhcpd.conf" "/usr/local/etc/namedb/named.conf" "/usr/local/etc/namedb/dynamic/thundat00th.net.db" "/var/cron/tabs/root" "/usr/local/etc/dhcp6c.conf" "/etc/rtadvd.conf" "/usr/local/etc/dhcpd6.conf" "/etc/dhclient.conf" )
|
||||
echo "Backing up "$i
|
||||
/bin/cp $i /root/fw$i
|
||||
end
|
||||
|
||||
echo "git push"
|
||||
cd /root/fw/
|
||||
/usr/local/bin/git add .
|
||||
/usr/local/bin/git commit -S -m "nightly backup"
|
||||
/usr/local/bin/git push -u origin main
|
Loading…
Reference in a new issue