data backup script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting data backup script
# 1  
Old 12-03-2008
data backup script

someone please guide me for following task

1. how can i make script that copy data from specified folder to destination folder

2. make tar for the current system date

3. establish ftp connection to backup server and place that tar file there.


Regards,

Mazhar
# 2  
Old 12-03-2008
Question What have you tried to accomplish this?

It would appear that a simple search here on each of the three questions would provide insight. Or, read on your system by man cp to learn more about the copy command (for instance).
# 3  
Old 12-03-2008
#!/bin/sh
date=`date +%F%R` #space between date and +
longdate=`date +%m%d%y`

tar -cf homedir.tar /home/userdir/*
cp /root/homedir.tar /root/homedir.$longdate.tar

#######################

Here is another script you can modify and combine with the above script
#!/bin/bash
# Shell script to copy all files recursively and upload them to
# remote FTP server (copy local all directories/tree to remote ftp server)
#
# If you want to use this script in cron then make sure you have
# file pointed by $AUTHFILE (see below) and add lines to it:
# host ftp.mycorp.com
# user myftpuser
# pass mypassword
#
# This is a free shell script under GNU GPL version 2.0 or above
# Copyright (C) 2005 nixCraft

FTP="/usr/bin/ncftpput"
CMD=""
AUTHFILE="/root/.myupload"

if [ -f $AUTHFILE ] ; then
# use the file for auth
CMD="$FTP -m -R -f $AUTHFILE $myf $remotedir $localdir"
else
echo "*** To terminate at any point hit [ CTRL + C ] ***"
read -p "Enter ftpserver name : " myf
read -p "Enter ftp username : " myu
read -s -p "Enter ftp password : " myp
echo ""
read -p "Enter ftp remote directory [/] : " remotedir
read -p "Enter local directory to upload path [.] : " localdir
[ "$remotedir" == "" ] && remotedir="/" || :
[ "$localdir" == "" ] && localdir="." || :
CMD="$FTP -m -R -u $myu -p $myp $myf $remotedir $localdir"
fi

$CMD
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

How i can backup data's to External Drive in Solaris 10/11?

Hello all, I'm new member and it's a very important for me. I need to backup data's from 3 server ( V880, M5000m and V490) I dont have a chance to use NFS. So i need to backup to Usb External Drive, can you help me with this issue? I dont have any experience about backup, but i need to... (1 Reply)
Discussion started by: sahkel
1 Replies

2. UNIX for Dummies Questions & Answers

How to get cpanel backup data in rescue mode?

How to get cpanel backup data in rescue mode? Server OS 6.3 minimal with cPanel /dev/sdb1 is main partition root@rescue ~ # fdisk -l Anyone can help Thank you (0 Replies)
Discussion started by: jaydul
0 Replies

3. Shell Programming and Scripting

Help with Backup Shell Script for Network Device Configuration backup

HI all, im new to shell scripting. need your guidence for my script. i wrote one script and is attached here Im explaining the requirement of script. AIM: Shell script to run automatically as per scheduled and backup few network devices configurations. Script will contain a set of commands... (4 Replies)
Discussion started by: saichand1985
4 Replies

4. Shell Programming and Scripting

Oracle Data BackUp with Help Of Perl

Hi All I am able to connect my oracle database with Perl and able to execute the queries. There is one schema names master19 which contains 50 table. I want to take backup of each table in and store at a given directory location in Perl For example suppose if a table student is present in... (3 Replies)
Discussion started by: parthmittal2007
3 Replies

5. Shell Programming and Scripting

Oracle Data BackUp with Help Of Perl

Hi All I am able to connect my oracle database with Perl and able to execute the queries. There is one schema names master19 which contains 50 table. I want to take backup of each table in and store at a given directory location in Perl For example suppose if a table student is present in... (1 Reply)
Discussion started by: parthmittal2007
1 Replies

6. Shell Programming and Scripting

rsync backup mode(--backup) Are there any options to remove backup folders on successful deployment?

Hi Everyone, we are running rsync with --backup mode, Are there any rsync options to remove backup folders on successful deployment? Thanks in adv. (0 Replies)
Discussion started by: MVEERA
0 Replies

7. Shell Programming and Scripting

How to incrementally backup data & use most recent data

Hey, dunno if the title really explains this well; basically my problem is (and this is on a router which is why the flash issue)... I have some data I want to store (it's really irelevant, i'm just counting the lines per file, basically a simple counter). I could store this data in flash but... (0 Replies)
Discussion started by: pepsi_max2k
0 Replies

8. UNIX for Dummies Questions & Answers

Backup Data to tape

Hi everyone!!! I have a question on incremental backup`s and full backup`s? We currently use the Round-Robin schema to do full backup`s on a daily basis but want to change that as our data is increasing. I would like to imply the Grandfather-father-Son policy taking a full backup on the 1st of... (1 Reply)
Discussion started by: donovan
1 Replies

9. AIX

AIX v.5.1 - system and user data backup

Hi everyone, I have no AIX experience at all. We have an IBM Server running AIX v.5.1. The server has a DDS-4 tape drive. I need to take complete system and user data backup.Should be able to restore the system and the user data in the event of system corruption or disaster. I was told that for... (5 Replies)
Discussion started by: Sezgin
5 Replies

10. UNIX for Advanced & Expert Users

backup data with tar and show them

Hey everyone, i just want to backup data with tar. I know it works with: tar cvf. To show which data i have saved i can use tar tvf. But how can i do it simoultanous, that unix not first has to save my data to disk and after that read the data again to show me the list of my saved data? Please... (2 Replies)
Discussion started by: grashuepfer
2 Replies
Login or Register to Ask a Question