LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-01-2014, 09:13 PM   #1
pbxuser911
LQ Newbie
 
Registered: Oct 2009
Location: USA
Posts: 12

Rep: Reputation: 0
TAR folder and send it to FTP


Hi All,

I am trying to setup a script that will ZIP up a directory and send it to a FTP Server

i am using this to create a backup from my 1 working directory and back it up nightly

here is the script i am using


#!/bin/sh


USER="user1"
PASSWD="password1"
HOST="HostIP"
# tar -zcvf /user1/PBXBackups/Backup.tar.gz /usr/local/pbx
FILE="/var/www/PBXBackups"
cd /user1/PBXBackups
ftp -n $HOST <<!EOF!
user $USER $PASSWD
binary
prompt
mput Backup.tar.gz
quit
!EOF!



Is this looking good? any suggestions ?
 
Old 11-01-2014, 09:53 PM   #2
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,313

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
it would be easier and more secure to just use scp.
 
Old 11-01-2014, 10:19 PM   #3
pbxuser911
LQ Newbie
 
Registered: Oct 2009
Location: USA
Posts: 12

Original Poster
Rep: Reputation: 0
Would you be able to assist me with modifying the script to use SCP ?
 
Old 11-02-2014, 08:23 AM   #4
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,313

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
the basic syntax is:
Code:
 scp user1@host1:/whatever/floats user2@host2:/your/boat
for automation you should set up keys:
http://www.linuxquestions.org/linux/...ation_with_ssh
 
Old 11-02-2014, 09:52 AM   #5
pbxuser911
LQ Newbie
 
Registered: Oct 2009
Location: USA
Posts: 12

Original Poster
Rep: Reputation: 0
can you explain to me what info goes where in that script, user1 is the username of where?
and user2 is from where?
 
  


Reply

Tags
centos, ftp, linux



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
change tar.gz folder to zip folder umucar Linux - Desktop 3 09-09-2014 07:19 AM
[SOLVED] Renaming a folder which is default folder for FTP account anon091 Linux - Newbie 6 02-11-2011 09:30 AM
send files and folder ftp infonlinebr Linux - Newbie 3 08-01-2008 12:13 PM
want to 'tar' a folder without some contents of folder shipon_97 Linux - Newbie 5 10-13-2007 04:21 AM
How to tar a folder and send it in FTP on another server ? SethShannon Linux - Newbie 2 09-28-2007 01:27 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:45 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