|
|
Top: lottalinuxlinks.com: The Weblog
blog feed |
podcast feed |
ogg feed |
forum
|
lottalinuxlinks cafepress store
|
Mon, 14 Aug 2006
Convert a dos file foramtted text file to a unix file formatted text file vim dosfile.txt Step 2 :set ff=unix Step 3 :qw posted 22:41 [/podcast/shownotes] permanent link Create a time stamped text file in vim Easy as pie. posted 22:39 [/podcast/shownotes] permanent link my simple backup script revisited Assumptions made in this example: 2424 is the alternate port number, and public key has already generated and exchanged with remote computer. Substitute username with your username, substitute backup_computer_name with the name of the remote computer you are backing up to, and substitute /stuff/backup/ with the directory path on the remote computer where you will be storing the backups. Substitute /bigbox/backup/ with the directory path on the second hard drive on the remote computer where you will be copying the tarball that was created on the first hard drive. #!/bin/bash # example backup script tar zcf - /etc/apache/ | ssh -p2424 backup_computer_name "cd /stuff/backup;cat > apache.tgz;cp apache.tgz /bigbox/backup/apache.tgz"; tar zcf - /home/username/bin/ | ssh -p2424 backup_computer_name "cd /stuff/backup;cat > home_username_bin.tgz;cp home_username_bin.tgz /bigbox/backup/home_username_bin.tgz"; tar zcf - /home/username/download/ | ssh -p2424 bakup_computer_name "cd /stuff/backup;cat > home_username_download.tgz;cp home_username_download.tgz /bigbox/backup/home_username_download.tgz" tar zcf - /var/www/ | ssh -p2424 backup_computer_name "cd /stuff/backup;cat > www.tgz;cp www.tgz /bigbox/backup/www.tgz" # exit cleanly exit 0
This script is best run from a cron job as root. posted 22:38 [/podcast/shownotes] permanent link 200 linux tips added to tip database posted 22:25 [] permanent link
|
voice mail
or call 864-372-4028
|