Cron Job To Send Backup Copy

Jun 3, 2009

Is it possible to get [Crone job] that sends a backup copy for single user in the server to another hosting via FTP which has [Domain name/ User /Password] either weekly or 3 times a week

View 10 Replies


ADVERTISEMENT

HOWTO Cron Job To Copy Files From Folder To Root

Feb 5, 2008

how to setup a cron job to copy files & directories from one folder to the root folder. I have CPanel X.

My root directory is public_html/
I have another directory public_html/uploads containing both files and directories.

I need a cron job that will copy all the files & directories from public_html/uploads to the root public_html/

If it helps, here is some system info

General server information:
Operating system Linux
Service Status Click to View
Kernel version 2.6.22_hg_grsec_pax
Apache version 1.3.39 (Unix)
PERL version 5.8.8
Path to PERL /usr/bin/perl
Path to sendmail /usr/sbin/sendmail
PHP version 4.4.4
MySQL version 4.1.22-standard
cPanel Build 11.17.0-STABLE 19434
Theme cPanel X v2.6.0

View 1 Replies View Related

Plesk 12.x / Linux :: Creating Lot Of Email Address With Redirect And Send Copy To

Nov 28, 2014

Under plesk 12.0.18, I would like to create thousand email address with redirect and send copy to. Its a long work to do.

Is there a solution to create all these email via an import csv, xls or else ?

View 2 Replies View Related

Plesk Automation :: Uploading Backup - Copy File Failed

Apr 28, 2014

I'm trying to upload backup ms sql server file. But the Control panel tells me error: "Error: copy_file failed: filemng cp failed:"

"The issue usually occurs due to exceeded disk quota. Check it."

View 6 Replies View Related

How Can I Backup CPanel With Cron

Nov 6, 2008

I just went through a week of nightmares, because my host lost hard drives and stuff.. lost my data, etc.. what ever..

I want to work out how I can cron cPanel backups. I did a search online for a cPanel backup manager, but I didn't have much luck.

Or, maybe there's some other way to get regular backups?

I don't really need to backup my whole sites. I keep my files locally, but of course I don't have the databases locally -- or the email records.

All I "really" need is the database SQL files, so that I can rebuild my forums if need be, and also the email setup files -- because I have over 50 domains and I have emails set up on all of them.

I want to have them emailed to myself.

There's an option in cPanel too, which allows me to "generate/download a full backup".. well, how do I "restore" the backup? ie: I know how to backup and restore the home directory, databases and email stuff (there's 3 options in cPanel), but there doesn't seem to be anywhere to restore the full backup.

Anyway, can anyone give me advice on how to keep backups of my cPanel accounts? I don't trust hosts anymore. They say they back stuff up, but they never to.

View 5 Replies View Related

How To Backup Database Via Cron

Jul 21, 2008

i need to backup database,that not that much huge a small database,now iam useing cpanel server so iam takeing via phpmyadmin manually,now i need to set cron to take backup at every 12hours and save it on specified path,

View 11 Replies View Related

Cpanel Cron Backup To Ftp

Nov 19, 2007

Im setting up new windows server, packed with only FTP server (FileZilla) to remote backups.

How can i get my cpanel account make backups and upload them to my FTP server as an cron job? Offcourse i have option to backup via cpanel, but this is needed to do manually every time (setting remote ftp ip, account, passwd etc,).

Is there a option in cpanel / whm to do full-backup all my accounts in my reseller account? Or do i need to do it per account? Some of my servers is only reseller accounts without root access, only reseller account.

View 1 Replies View Related

Backup MySQL Databases By Cron

Apr 1, 2007

how to backup MySQL databases by cron and have the backups sent to you by email, or have them uploaded by FTP. It is based on a script I found at another website though I can confirm it is fully working.

Change the commented variables in the following file and save it as backup.sh:

Code:
#!/bin/sh

# This script will backup one or more mySQL databases
# and then optionally email them and/or FTP them

# This script will create a different backup file for each database by day of the week
# i.e. 1-dbname1.sql.gz for database=dbname1 on Monday (day=1)
# This is a trick so that you never have more than 7 days worth of backups on your FTP server.
# as the weeks rotate, the files from the same day of the prev week are overwritten.
#/bin/sh /home/user/directory/scriptname.sh > /dev/null
############################################################
#===> site-specific variables - customize for your site

# List all of the MySQL databases that you want to backup in here,
# each seperated by a space
# If not run by root, only one db per script instance
databases="mydbname"

# Directory where you want the backup files to be placed
backupdir=/home/mydomain/backups

# MySQL dump command, use the full path name here
mysqldumpcmd=/usr/bin/mysqldump

# MySQL Username and password
userpassword=" --user=myuser --password=mypasswd"

# MySQL dump options
dumpoptions=" --quick --add-drop-table --add-locks --extended-insert --lock-tables"

# Unix Commands
gzip=/bin/gzip
uuencode=/usr/bin/uuencode
mail=/bin/mail

# Send Backup? Would you like the backup emailed to you?
# Set to "y" if you do
sendbackup="n"
subject="mySQL Backup"
mailto="me@mydomain.com"

#===> site-specific variables for FTP
ftpbackup="y"
ftpserver="myftpserver.com"
ftpuser="myftpuser"
ftppasswd="myftppasswd"
# If you are keeping the backups in a subdir to your FTP root
ftpdir="forums"

#===> END site-specific variables - customize for your site
############################################################

# Get the Day of the Week (0-6)
# This allows to save one backup for each day of the week
# Just alter the date command if you want to use a timestamp
DOW=`date +%w`

# Create our backup directory if not already there
mkdir -p ${backupdir}
if [ ! -d ${backupdir} ]
then
echo "Not a directory: ${backupdir}"
exit 1
fi

# Dump all of our databases
echo "Dumping MySQL Databases"
for database in $databases
do
$mysqldumpcmd $userpassword $dumpoptions $database > ${backupdir}/${DOW}-${database}.sql
done

# Compress all of our backup files
echo "Compressing Dump Files"
for database in $databases
do
rm -f ${backupdir}/${DOW}-${database}.sql.gz
$gzip ${backupdir}/${DOW}-${database}.sql
done

# Send the backups via email
if [ $sendbackup = "y" ]
then
for database in $databases
do
$uuencode ${backupdir}/${DOW}-${database}.sql.gz > ${backupdir}/${database}.sql.gz.uu
$mail -s "$subject : $database" $mailto < ${backupdir}/${DOW}-${database}.sql.gz.uu
done
fi

# FTP it to the off-site server
echo "FTP file to $ftpserver FTP server"
if [ $ftpbackup = "y" ]
then
for database in $databases
do
echo "==> ${backupdir}/${DOW}-${database}.sql.gz"
ftp -n $ftpserver <<EOF
user $ftpuser $ftppasswd
bin
prompt
cd $ftpdir
lcd ${backupdir}
put ${DOW}-${database}.sql.gz
quit
EOF
done
fi

# And we're done
ls -l ${backupdir}
echo "Dump Complete!"
exit
Upload backup.sh to your server, to any directory you want. A directory which is not web-accessible will stop your login information being seen by just anyone .

You should chmod the file to 777:

Code:
chmod 777 backup.sh
If you uploaded this file from a Windows machine you will need to convert the file to Unix format. You should run the following command by SSH in the appropriate directory:

Code:
dos2unix backup.sh
If you don't have dos2unix installed, you can install it using yum if you have that:

Code:
yum install dos2unix
If you don't have yum, get it here.

You may want to test the script at this point to make sure it's doing what you want it to. Change to the appropriate directory and run this command:

Code:
./backup.sh
Once you're happy with it, enter it into the crontab to run daily (or whenever you want). Cron jobs vary a lot depending on the configuration of your system, so check Google for how to do it on your system. The command you will need to run by cron is:

Code:
/path/to/file/backup.sh

View 2 Replies View Related

Cron Job That Deletes Backup Files Older Than 5 Days

May 31, 2009

This is on a RHEL 4 Box.

I want to create a cron job that deletes backup files that are older than 5 days. I have created a shell script (/usr/local/src/runjob.sh) that runs successfully from the SSH command line:

Code:
#pwd
/usr/local/src
#./runjob.sh
Here is the script:

Code:
#!/bin/sh
#

#
find /usr/local/apache/sites/*/BACKUPS/ -maxdepth 1 -atime +5 -iname 'test*.txt' -exec rm {} ;
Script has 777 permissions and is owned by root.

I have the following entry in crontab:

Code:
10 12 * * * /bin/sh /usr/local/src/runjob.sh >/dev/null 2>&1

As shown in the cron log, the job does run, but it does not delete the files. And there are files older than 5 days in the directory that meet the find criteria.

View 12 Replies View Related

Is It Possible To Create A Cron To Backup Mysql Data Daily

May 15, 2009

Is there any way to create a cron to backup mysql data daily ( or weekly )? I mean an "auto script" to run this command daily

mysqldump -u usernam -p password dataname > file.sql

View 11 Replies View Related

Plesk 12.x / Linux :: Scheduled Backup Don't Load (cron Job)

Jul 14, 2015

Plesk Backup work when we make instant backup but not with scheduled backup.

There is nothing in the log files (pmmcli.log & migration.log).

How can we correct?

Plesk 12 / Centos

View 1 Replies View Related

Copy An Account From Another Server Via WHM - Cannot Copy Mysql Database

Oct 7, 2008

In previous thread we made few manual transfer of our domains.

We also made some automated migration of few domains/sites using Web Host Manager's Copy an account from another server feature.

All the files and other settings were properly transferred from old server to new server, but only the mysql database is not visible on new server. I am unsure if the same got copied to new server.

View 4 Replies View Related

Copy Sql

Jan 11, 2008

How do I copy an entire mysql sql database file via ssh?

Inside /var/lib/mysql the sql are per table, not one single sql. The db is over 300mb in size too.

Using mysql 5/centos 4.6

View 2 Replies View Related

To Copy Dns To New Server

Mar 27, 2009

I have around 40 domains and I'm trying to avoid copying each one over manually. I can't remember what files need to be copied and the best command to do that.

View 7 Replies View Related

Rsync Copy

Apr 7, 2009

I have wrote a small script which copies file names which has name as *default* from backup to users main folder. It works fine with one folder but doesn't copy files from sub-folders.

it works with all the sub-folders as well?

HTML Code:
#!/bin/bash

for i in $(ls /var/cpanel/users)

do
rsync -vrplogDtH /backup/cpbackup/weekly/$i/homedir/public_html/*default* /home/$i/public_html

chown -R $i.$i /home/$i/public_html/*default*

done

View 2 Replies View Related

DD Copy Mount

Jan 29, 2008

I want to use DD to fully duplicate a HD, however, the HD is 120GB and also have a mount folder that is 2TB. If I use DD, will it also trying to copy that 2TB onto my 2nd HD?

View 3 Replies View Related

Copy Dot Files

Feb 23, 2007

How do I copy all files and directories recursively to another folder?

I did:

cp --preserve -r /sourcefolder/* /destinationfolder/

However, it missed the dot files

View 2 Replies View Related

Copy Server To A New HD

May 18, 2007

It turns out my 250GB hard drive was no match for my data... I need to upgrade the HD.

I'm currently using ClarkConnect Community Edition.

Is it fine to make a duplicate of an existing hard drive and just plug the new one in?

Is there any further configuring or is it all sweet?

Also, what software do you recommend to make the copy?

View 1 Replies View Related

How To Copy Accounts

Jan 21, 2007

I have 2 cpanel servers with root access.

I want to copy all the accounts from 1 server to another.

View 2 Replies View Related

How Do Install A Local Copy Of TAR ?

Jul 30, 2006

wasn't sure if this should go into "technical" or "programming" but I figure someone here will instantly be able to tell me...

(details: I'm on a shared host with cpanel and centos 3)

My hosting service techs refuse to update gnu TAR on the server even though it's several years old at 1.13 and has some know bugs that are annoying for complex calls - (basically the techs use any request like this to try to upsell me to dedicated or VPS which I don't need at my low level)

So I'd like to install a "local" copy of the newer gnu 1.14 or 1.15 TAR (which I *think* is possible?) into my account and have it run instead of the shared copy?

Unfortunately this is beyond my knowledge so thanks for any help in the right direction...

View 3 Replies View Related

How To Copy Large Directory Via SSH

Jul 9, 2009

I have a large directory which I want to copy to another account on the same server. Its 1 folder which contains 20000+ files and its around 2GB in size.

I used:

Quote:

cp -r /home/useraccount/public_html/foldername /home/useraccount2/public_html

It worked but some of the files didn't transfer correctly,

View 11 Replies View Related

How To Copy Files From One Server To Another

May 1, 2008

I have about 1.80GB of flash games and I want to copy this flash games to another server, I only want to copy the flash games not the entire account.

FYI I have shell access on both server.

View 5 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved