Jump to content

Recommended Posts

Posted (edited)

Thanks.

 

Two things:

 

1. Should I rename the file, removing the .2.2 extension at the very end (it seems to imply it in the script)?

 

2. I've put the file in my root directory, having set the settings. Is there any way I can test it?

Edited by KyanVrezpor
Posted

1) Yes, you should remove the '.2.2' from the file name after uploading the script to the server.

 

2) You'd test it by setting up a cron job to run the script, wait for the cron job to run, then see if the script does what you configured it to do.

Posted

a) Yes, you'd need a cron job to run the script normally. The cron job is what will run your script automatically on the day(s) and time you specify in the cron job.

 

b) You'd specify the full server path to the script as the command to run. Example:

>/home/cpanelName/public_html/automysqlbackup.sh

I'd recommend setting the permissions on automysqlbackup.sh to 0744 so it's executable only by you.

Posted
I'm getting this error:

 

mkdir: cannot create directory `/backups': Permission denied

 

What permission settings to I need to change, and what to?

You shouldn't need to change any permissions settings. The problem is that the BACKUPDIR option in the script is not configured correctly.

 

Whatever directory you store the backups in must be below your home directory on the server (/home/cpanelName - where 'cpanelName' is your CPanel username). If you wanted the backups to actually go into a "backups" directory, edit the script to the following:

>BACKUPDIR="/home/cpanelName/backups"

...and change 'cpanelName' to your actual CPanel username.

 

Hope this helps...

Posted

It looks to me like you've configured the MAILCONTENT option to "log" so the script would e-mail you the backup log. I'd recommend changing this option to "stdout" instead and let cron e-mail the log file to you.

Posted

One further question - so are you meant to configure when the script is to run through "Cron Jobs" or in the script itself? There seem to be some settings in the script as to when it should run, but I have been told to use Cron Jobs. Could this be cleared up?

 

Thanks:D

Posted

The script should be set up in a cron job to run once per day. The only config option I see relating to time is the DOWEEKLY option, which tells the script what day of the week it should make weekly backups.

Posted

So does the script automatically do weekly backups as well, even if you don't set the Cron Jobs for a weekly backup?

 

Sorry about the mass of idiotic n00b questions, you've been great answering them :flex:

Posted

Yes, the script automatically does weekly (and monthly) backups. When the script runs each day, it checks today's day of the week to see if a weekly backup needs to be made, and it checks the day of the month to see if a monthly backup needs to be made (they're done on the 1st of each month).

Posted (edited)

But why do you need weekly backups if you're already doing daily backups?

 

--> Or are you in fact not doing daily backups? I'm confused :flex:

Edited by KyanVrezpor
Posted

The script automatically performs daily, weekly, and monthly backups. To limit how much disk space the backups use, the script only keeps the last 7 daily backups, and the last 5 weekly backups. When a new daily backup is made, the daily backup from a week ago is deleted. When a new weekly backup is made, the weekly backup from 5 weeks ago is deleted. Monthly backups are kept indefinitely. The process of deleting an old backup when a new one is made is what's known as 'backup rotation'.

 

The weekly and monthly backups allow you to keep backups of your data farther back than a week in time without having to keep a daily backup of your database for every single day of the last month, last 3 months, 6 months, 12 months, etc. This allows you to restore your data from a point in time earlier than a week ago if the need should arise without having to keep dozens or hundreds of daily backups stored on the server.

Posted (edited)

I see now, didn't understand the whole rotation thing.

 

Your customer services never ceases to amaze me, I'm very glad I chose totalchoice hosting.

 

Thanks again :flex:

 

One further question -> is it possible to do the same with files on your server?

Edited by KyanVrezpor
Posted

Depending on what type of website you are building will it change frequently enough to warrant synchronizing folders all the time. When ever I make significant changes to my site I perform a backup through cPanel and that's sufficient. I do back up my databases daily.

  • 1 year later...
Posted

Touching on this same subject. . .

 

When I go to make a chron job for this, I am using the standard chron manager in my cPanel. I was wondering, under the "Weekdays" selection list, am I able to select multiple days, such as monday, wednesday, and friday or am I supposed to create a seperate chron job for each day?

 

Thanks in advance ;)

Posted
I have never used the cron job option, but I would think you would only use the same cron job for all the days you enter.

 

Hrrrm, perhaps I wasnt clear enough or I misunderstand your response. Ler me clarify a bit. In the chron manager there is a list of days I can select to run the job, clicking on just one, it will run the job that day. Is it possible to control+click multiple days in the list and have it run or do i have to set up a seperate job for Mon, Wed, and Fri. runs?

 

Thanks for your help and patience.

Posted
Hrrrm, perhaps I wasnt clear enough or I misunderstand your response. Ler me clarify a bit. In the chron manager there is a list of days I can select to run the job, clicking on just one, it will run the job that day. Is it possible to control+click multiple days in the list and have it run or do i have to set up a seperate job for Mon, Wed, and Fri. runs?

 

Thanks for your help and patience.

 

 

I've never used the "Easy" mode, or whatever it's called, but cron will let you run the same job on multiple days. When entered by hand you separate the days with a comma. If you want it to run everyday, then an astrisk (*) suffices.

 

Thus, in the "Easy" mode which presents a list of days, if it is from a scrollable select list, rather than buttons, then CTRL+Click will work on Windows and Linux, while CMD+Click will work on Mac OS to select multiple days.

Posted
Yes, you can CTRL-click to select multiple but since it's a backup why not select Every Weekday?

 

 

Hehe...::shrugs:

 

I guess I was looking at disk space on my host, doesnt that put a back-up of each DB into my directory each day? Basically we do changes to our databases approx 3 days/week, and we wanted to back the info up before the update in case anything went wrong, in which case we could just revert back.

 

By the way, I dont hink I have ever stated this on the forums, but I LOVE TCH. IMO its the best host out there. I have been with you guys for over 2 years now, never had a problem with your service, and the customer support is OUTSTANDING! :Pats TCH and its employees on the back::

Posted
I guess I was looking at disk space on my host, doesnt that put a back-up of each DB into my directory each day?

Depends on what script you are using to perform the backup.

 

The one I use emails the backup to me nightly and deletes it so there is never a backup on the server.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...