LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 06-25-2004, 07:18 AM   #1
dennis_89
LQ Newbie
 
Registered: Jun 2004
Posts: 27

Rep: Reputation: 15
linux backup to external drive


Does anyone know if there is a way to backups to an external hard drive. The script I am running is on a linux box, but the external drive is on an XP machine. I want to be able to run the backup and have the tar files saved to the external hard drive.

Code I am using is as follows:

#!/bin/bash
#This script is to be used to backup to disk directories that
#may be scattered around a network on Microsoft Shares.
#Written by: Dennis Williams
#Date: June 18, 2004
#
#--------------Environment variables for protocaselaptop--------------------
#
#this is the administrator account on the windows machines
USERNAME1=administrator
PASSWORD1=administrator_password
#
#---the place you want to do the backup to
#
#DRIVE=/some/path/to/directory
DRIVE=//laptop/backup/backup ###This is where I try to save
#
#
#You will need to create more of these sections,
#one for each machine that you wish to do a backup of
#TARGET_MACHINE and BACKUP_SHARE are the names
#of the target machine and the shared directory
#
#TARGET_MACHINE=machine_name
#BACKUP_SHARE=share_name
#
TARGET_MACHINE=Protocaselaptop
#BACKUP_SHARE=outlook
#
mkdir $DRIVE/$TARGET_MACHINE
cd $DRIVE/$TARGET_MACHINE
#
smbclient //$TARGET_MACHINE/Outlook $PASSWORD1 -U $USERNAME1 -c "recurse;prompt;mget *;"
#
tar cvpz $DRIVE/$TARGET_MACHINE > $DRIVE/$TARGET_MACHINE.tar.gz
rm -rf $DRIVE/$TARGET_MACHINE
#
#You will be left with a file called protocaselaptop.tar.gz
#located in the /root/backup/target_machine directory you specified in the $DRIVE variable
#

Cheers,

dennis
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to clone or backup Linux boot drive? RodWC Linux - General 8 11-13-2005 09:00 AM
access external hard drive linux partition on linux and vice versa garyozzy Linux - Newbie 2 08-03-2005 06:11 PM
Laptop DVD drive has died, will linux boot from an external drive? Stevetgn Linux - Newbie 2 05-14-2005 05:18 PM
External drive will not backup when formatted to VFAT32 linuxmarine Linux - Hardware 1 03-25-2005 04:50 AM
Hard Drive System Backup of Linux? KarlT Linux - Software 2 12-20-2003 08:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 12:05 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration