LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
LinkBack Search this Thread
Old 11-27-2004, 11:35 AM   #1
Napper
Member
 
Registered: Nov 2003
Distribution: Ubuntu Warty
Posts: 56

Rep: Reputation: 15
Question Software needed for pushing files to ftp servers.


Hi everybody,

before I go to reinvent the wheel again, let me ask on _the_ forum I wrote a need little PHP application that I have a small custumer base for. Since I keep developing that software I need to keep updating each customer installation (let us assume that I have their ftp access data). Now I could write a script that loads each the ftp access for each customer and sends all the (modified) files over to his/her server. However, maybe something like that (or even a nifty GUI app) already exists. Is anybody aware of such a program?

In hope for reply,

Napper.
 
Old 11-27-2004, 12:17 PM   #2
sigsegv
Senior Member
 
Registered: Nov 2004
Location: Third rock from the Sun
Distribution: NetBSD-2, FreeBSD-5.4, OpenBSD-3.[67], RHEL[34], OSX 10.4.1
Posts: 1,197

Rep: Reputation: 46
This isn't really a direct answer but more a "this is how I mould do it" kind of thing.

Put each server's connect string in a file, one per line (like so)

Code:
ftp://username:password@host.com/path/to/your/file
ftp://username:password@host.com/path/to/your/file
...
then have a script that reads the file. Something like this

[code]
#!/bin/sh

for HOST in `cat /file/from/above`; do
ftp ${HOST} << !EOF!
bin
put yourPhpScript.php
bye
!EOF!
done

You could expand this to check the php script's mtime and run any time the file's been updated, then tie that into a cronjob. That way, you just edit the php script and cron merrily takes care of the work and sends you an email when it's done.

BTW -- GUIs suck for things like this. Like I always say "X is for browsing and a ton of (a|e|x)terms" ;)
 
Old 11-27-2004, 12:22 PM   #3
Napper
Member
 
Registered: Nov 2003
Distribution: Ubuntu Warty
Posts: 56

Original Poster
Rep: Reputation: 15
Yeah what I thought. It's scripting time after all... Thanks for the start!!!

Napper
 
Old 04-02-2005, 06:57 AM   #4
Napper
Member
 
Registered: Nov 2003
Distribution: Ubuntu Warty
Posts: 56

Original Poster
Rep: Reputation: 15
Hello again,
I am slowely progressing in the art of bash programming and wrote some simple backup scripts (inspired by your previous input). As I have to manage quite a few web sites that are located on remote hosts I was wondering if there was a way initiate a mysql backup of these remote databases. Essentially what the script should do is:

1) Log into the hosts MySql server
2) Dump the specified database
3) Write the file into a local (on my home computer, so to speak) folder

Is this possible with Bash?

Kind regards,

Napper
 
Old 04-02-2005, 07:42 AM   #5
sigsegv
Senior Member
 
Registered: Nov 2004
Location: Third rock from the Sun
Distribution: NetBSD-2, FreeBSD-5.4, OpenBSD-3.[67], RHEL[34], OSX 10.4.1
Posts: 1,197

Rep: Reputation: 46
I'd do this in 2 scripts; one on the servers and one on your box.

The script on the server(s) should dump the databases and whatever else you want into a tarball (server1.mydomain.com-backup-20050402.tar.gz) on a disk with plenty of space to hold it.

The script on your box would just SCP the tarballs to your local HDD.

One of the two scripts should take care of cleaning out the old tarballs on both ends, otherwise you'll have to manually delete the old tarballs manually.


Last edited by sigsegv; 04-02-2005 at 07:44 AM.
 
Old 04-02-2005, 07:47 AM   #6
Napper
Member
 
Registered: Nov 2003
Distribution: Ubuntu Warty
Posts: 56

Original Poster
Rep: Reputation: 15
Makes sense. And the server side script would be in php right?
 
Old 04-02-2005, 02:20 PM   #7
sigsegv
Senior Member
 
Registered: Nov 2004
Location: Third rock from the Sun
Distribution: NetBSD-2, FreeBSD-5.4, OpenBSD-3.[67], RHEL[34], OSX 10.4.1
Posts: 1,197

Rep: Reputation: 46
No. I'd jush use a shell script triggered by cron.
Code:
#!/bin/sh

# Get the date
# DATE=`date +"%Y%m%d"

# Dump the databases
# mysqldump <options> database | gzip - > /tmp/database_dump_$DATE.gz
You'll have to change it up for your situation of course.
 
  


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help, what services are needed for a windows to access Linux servers Wolfy Linux - Networking 6 07-12-2004 08:36 PM
Software Needed To Transfer Files Elite_Gamer04 Linux - Software 9 06-14-2004 06:45 PM
FTP Servers torman89 Linux - Software 3 11-30-2003 07:36 PM
Pushing files from a Linux box to a Windows Box scottpioso Programming 2 11-27-2003 02:29 PM
Software for synchronizing files on web servers josephswagner Linux - Software 2 02-06-2003 12:13 AM


All times are GMT -5. The time now is 10:20 AM.

Main Menu
 
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
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration