cronjob for auto daily backups

chadi

BANNED
Apr 20, 2004
415
0
166
how do i create a cronjob (ok i know the button is in cpanel lol) for a script to do auto backups on my second mounted hard drive for certain sites only (not all)?
 

BrightAdmin

Well-Known Member
Feb 29, 2004
204
0
166
Hi,

You can create a cronjob from shell by
# crontab -e

Syntax:
minute hour day-of-month month-of-year day-of-week tar /path/to/your/file /path/to/store/yourtarfiles

Ex:
30 18 * * * tar /var/www/html/ /home/user/

Regards,

Bright:)
 

chadi

BANNED
Apr 20, 2004
415
0
166
Ok but how do i tell it to connect to the second mounted drive? How do I pull info on the drive as well?

Please explain how to restore, see complete details (free space, used space, etc.) via shell for my 2nd drive. Thanks.
 
Last edited:

chadi

BANNED
Apr 20, 2004
415
0
166
Another thing, the path FROM and TO my files?

I'm not sure what they should be in the command when I type but I'm on RHE Linux so what is the default for that?
 

chadi

BANNED
Apr 20, 2004
415
0
166
This is a SUPPORT FORUM as stated on cPanel's SUPPORT page. It doesn't mention anything about "official" or not. You're obviously not a cPanel tech or admin so don't bother speaking on their behalf and telling what is and is not. They can speak for themeselves. Also, "cronjob" is part of cPanel so therefore it is for them to "support" their control panel features. Think about that before you type your opinions on others' behalf.
 

PWSowner

Well-Known Member
Nov 10, 2001
2,901
4
343
ON, Canada
What thaphantom said is pretty much true, but I'll try to rephrase it a little nicer.

Cpanel forums is a support forum for the cpanel product, but not a source of support from the cpanel team. Once in a while one of them will try to help out, but mainly what this forum is, or has been since I came here, is a place for cpanel users to help each other out. For cpanel support, you need to submit a support ticket, but you are required to try your server or hosting provider first.

Cronjob isn't a part of cpanel. Cronjob is a program on the server. Cpanel is merely an interface to make some server admin jobs easier. Therefore, it's not cpanels job to teach anyone how to use the different functions that are available on the server.

Now, for your question, to do backups on a 2nd drive, you put your backup directory on that drive, use a script to create backups to save in the backup directory, and since that directory is on the 2nd drive, that's where the backups will be.
 

chadi

BANNED
Apr 20, 2004
415
0
166
Originally posted by thaphantom
lol your a joke.

Considering you have been here less than 2 weeks I wouldnt start speaking on what this forum is or is not.

Please look at my info, hell ask anyone here with that has more tahn 1k posts, they will tell you what this forum is...

Also a cronjob is not part of cpanel... and if you dont know that you sure as hell should not be running a server. cPAnel offers a web interface for it.
Now you dont want to use the web interface good for f***ing you! Dont expect them to tell you how to use it though.

now go RTFM.
You said it all incorrectly and impolitely, unprofessionally using foul language and childish manner. You're ignored.

Squirrel, cPanel doesn't state that the cPanel forums are NOT official, so am I born knowing this? They should be clear about this. You cannot assume a person comes onto the board as a newbie and automatically knows that the forums are not OFFICIAL support.

Phantom, you're so naive I'm so happy I'm not who you are. Clearly, you're angry because you cannot think of a smarter response I gave you, therefore respond in a more adult manner.
 

Website Rob

Well-Known Member
Mar 23, 2002
1,501
1
318
Alberta, Canada
cPanel Access Level
Root Administrator
Originally posted by chadi
how do i create a cronjob (ok i know the button is in cpanel lol) for a script to do auto backups on my second mounted hard drive for certain sites only (not all)?
You would need to create or have created, a script that is specific to what you ask. Then refer to that script within the Cron job settings.

You are also correct when you stated, "How is one supposed to know beforehand, this is not an Official Support Forum?" or words to the effect. Unless someone states in their sig that they are with DarkOrb, everyone is just another Licenesed Owner of Cpanel -- for the most part. There are no Moderators here and it's just the blind helping the blind.

So, if someone posts a reply to question, be thankful. If no one does, pass the question on to DarkOrb using the Support Center link in WHM.

Most of us here do take time to help others, but as you've already seen, we each post with our own style. ;)
 

chadi

BANNED
Apr 20, 2004
415
0
166
thanks for being a gentleman unlike someone else...and for replying with help

the problem is i don't know what the actual script is but i know my 2nd drive is already mounted to whatever letter (i'll find out in whm)

so what would the command line be?
 

Website Rob

Well-Known Member
Mar 23, 2002
1,501
1
318
Alberta, Canada
cPanel Access Level
Root Administrator
Your question has already been answered.

" You would need to create or have created, a script that is specific to what you ask. Then refer to that script within the Cron job settings."

What I would suggest is to just use WHM > Backup in the way it was meant to be used and set it for Incremental Backup -- which is faster.
 

chadi

BANNED
Apr 20, 2004
415
0
166
If i'm not mistaking I thought cPanel doesn't recognize second hard drives? Or am I wrong? I hope I'm wrong because this would be totally easier and make it more simple in steps. I know nothing much about ssh and scripts. My previous question was what is the script/command line.
 

Website Rob

Well-Known Member
Mar 23, 2002
1,501
1
318
Alberta, Canada
cPanel Access Level
Root Administrator
Dont' know why you'd think WHM doesn't recognize a second hard drive? As long as it has been properly formatted and mounted, you need ony refer to it by name within WHM > Backup, when you set you backup options.

Do a df -lh in shell to see what the second hard drive is called, if you're not sure.