Cron Jobs

Status
Not open for further replies.

royalbun

New Member
Messages
13
Reaction score
1
Points
3
Hello,
I am trying to write a cron job script that would temporarily archive my data, mail them to me, and then delete what ever archive created:

Code:
#!/bin/bash

#Make an archive of public_html
tar czf ~/backups/backup/html.tgz ~/public_html

#Make a back up of SQL database
mysqldump --opt -Q -u database_user --password='password' database_name | gzip > ~/backups/backup/SQL.gz

#Put them both in a nice package
tar czf ~/backups/backup.tgz ~/backups/backup

#mail it to me
mutt -a ~/backups/backup.tgz -s "File attached" -- email@address.com

#delete all files created
rm -rf ~/backups/*

The script doesn't work, and without a terminal, I have no idea what is wrong with it. I plan to run it monthly, but for testing purpose, I am making it run daily right now:
ubeRlkK.png


Any help?
 

bdistler

Well-Known Member
Prime Account
Messages
3,534
Reaction score
196
Points
63
The script doesn't work, and without a terminal
the only way a user of x10hosting's free-hosting can set a Cron job - is from [ cPanel-x3 ] theme's home page (not x10hosting Basic)

x10hosting's free-hosting accounts have no SSH
 

essellar

Community Advocate
Community Support
Messages
3,295
Reaction score
227
Points
63
The main problem is that you don't have shell access. PHP is all you have to work with on the Free Hosting servers.
 

royalbun

New Member
Messages
13
Reaction score
1
Points
3
The main problem is that you don't have shell access. PHP is all you have to work with on the Free Hosting servers.
Oh, OK. Is there a list of what are the commands I can use? Can I use like wget or something that invokes a restful address?
 
Status
Not open for further replies.
Top