LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-16-2009, 04:46 AM   #1
Sureshan
LQ Newbie
 
Registered: Jul 2009
Posts: 4

Rep: Reputation: 0
Question Plesk Cron Backup Script


I have found the following cron script for plesk:

#!/bin/sh
FTP_USER='your_ftp_accountname'
FTP_PASS='your_ftp_password'
DUMP="/var/www/vhosts/mydomain/database$(date +%g%m%d_%H%M).sql"

mysqldump -h mydomainip -u myusername -mypassword --add-drop-table -n \
--databases mydatabasefile >"${DUMP}"; [ ! -s "${DUMP}" ] && exit 1

ftp ftp.so.me.ho.st <<EOC
user $FTP_USER
$FTP_PASS
cd /upload/dir
put $DUMP
quit
EOC
exit 0


Question is how do I get it to transfer files that are unzipped?
 
Old 07-16-2009, 04:55 AM   #2
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976
Can you clarify a bit? What is the problem with the script? The ftp command put $DUMP will transfer the file "/var/www/vhosts/mydomain/database$(date +%g%m%d_%H%M).sql". If you need to transfer other files, just add other put statements.
 
Old 07-16-2009, 05:27 AM   #3
Sureshan
LQ Newbie
 
Registered: Jul 2009
Posts: 4

Original Poster
Rep: Reputation: 0
Thank you for response.

I have a SugarCRM installation and I want it to sync on a daily basis with a duplicate installation on another server. The only possible way I could think of, was running a cron script on my Plesk Panel. The problem is I need the files that are being transferred NOT to be zipped in order to sync accordingly. Now I have found the above script to execute the cron (I think)- but I am sure that this script zips the backup before transferring to the alternate server. Please note that I do not have any PHP experience and I am not sure if I am on the right track?

Regards..
 
Old 07-16-2009, 06:27 AM   #4
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976
Quote:
Originally Posted by Sureshan View Post
Now I have found the above script to execute the cron (I think)- but I am sure that this script zips the backup before transferring to the alternate server.
The script does not "execute the cron", you have to run it from a crontab. It just dumps the sql database and transfers it to the ftp server as is. I don't see any compression here. Why do you think the backup is compressed?
 
Old 07-16-2009, 06:44 AM   #5
Sureshan
LQ Newbie
 
Registered: Jul 2009
Posts: 4

Original Poster
Rep: Reputation: 0
How do I get it to send all the files in the http folder?
 
  


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
In plesk , I wish to have a backup cron job, ftp back up file to another ftp server? muskiediver Linux - General 6 07-16-2009 04:13 AM
Create a backup cron script brokenhalo Linux - Newbie 15 09-27-2008 12:44 PM
Cron backup script stops running after a few days brokenpromises Linux - Server 5 04-05-2008 06:30 AM
i want to cron a backup script sneakyimp Linux - Software 4 03-25-2008 10:02 PM
Backup script won't run in cron job. Why? Micro420 Linux - General 19 10-31-2007 09:26 PM


All times are GMT -5. The time now is 04:22 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration