Author Topic: Backup Script  (Read 6838 times)

Nightborn

  • Administrator
  • Sr. Member
  • *****
  • Posts: 318
  • Karma: +20/-0
    • View Profile
    • Shinobilegends
Backup Script
« on: July 19, 2008, 04:43:50 pm »
I recently rewrote my server backup script to something ... more fitting.

It's now from PHP rewritten completely to Perl. All you need is to be able to execute perl files.

if anybody is interested, please state so here.

brief description:

-monthly, daily, weekly backups
-daily get transferred via ftp
-generates or adds to a log file
-stderr is used for errors, if you execute it via cronjob (recommended) cron will email you any output to your email address
It should be fixed, but it won't be easy and it won't be fast. If you want
to help - wonderful. But keep in mind that it will take months of wading
through the ugliest code we have in the tree. If you've got a weak stomach -
stay out. I've been there and it's not a nice place.

   - Al Viro

Iori

  • Guest
Re: Backup Script
« Reply #1 on: July 25, 2008, 11:54:41 am »
Hi, I'd be interested in automated backups, as my server's backup functions seems to break things (as yet unresolved).

Nightborn

  • Administrator
  • Sr. Member
  • *****
  • Posts: 318
  • Karma: +20/-0
    • View Profile
    • Shinobilegends
Re: Backup Script
« Reply #2 on: July 25, 2008, 03:26:27 pm »
ok.

small checklist:

  • do you have Perl installed and usable on your machine?
  • do you have the mysqldump command you can use from the console (command line)
  • do you have the ability to run a cronjob from inside your CPanel or whatnot (NOT recommended to use free cronjobs from the outside, script should *not* be in any accessible directory or you will face random backups in the worst case or a full disc)

OOC:
At your dp post about showtabform, I'll check that and I believe I always wondered why "showtabformindex" is necessary to be saved ... I'll investigate that later as you brought it up and it sounds valid =)
It should be fixed, but it won't be easy and it won't be fast. If you want
to help - wonderful. But keep in mind that it will take months of wading
through the ugliest code we have in the tree. If you've got a weak stomach -
stay out. I've been there and it's not a nice place.

   - Al Viro

Iori

  • Guest
Re: Backup Script
« Reply #3 on: July 25, 2008, 04:00:44 pm »
ok.

small checklist:

  • do you have Perl installed and usable on your machine?
  • do you have the mysqldump command you can use from the console (command line)
  • do you have the ability to run a cronjob from inside your CPanel or whatnot (NOT recommended to use free cronjobs from the outside, script should *not* be in any accessible directory or you will face random backups in the worst case or a full disc)

1)There's a big list of installed perl modules viewable from cpanel...dunno if that means perl is installed
2) No idea. How do I find out?
3) yes, cpanel has crontab software

I will get in contact with the server's owner. Perhaps he could answer these questions...


Nightborn

  • Administrator
  • Sr. Member
  • *****
  • Posts: 318
  • Karma: +20/-0
    • View Profile
    • Shinobilegends
Re: Backup Script
« Reply #4 on: July 28, 2008, 02:50:49 pm »
Simply ask

"can I execute perl scripts I put in my web directory via crontab?"

"do you have the command mysqldump installed?"

"do you enable ftp transfer from within mentioned perl scripts?"
(last one optional if you want ftp or not)
It should be fixed, but it won't be easy and it won't be fast. If you want
to help - wonderful. But keep in mind that it will take months of wading
through the ugliest code we have in the tree. If you've got a weak stomach -
stay out. I've been there and it's not a nice place.

   - Al Viro

Iori

  • Guest
Re: Backup Script
« Reply #5 on: July 30, 2008, 10:00:44 am »
Sorry for the late reply. I am informed that commandline access is unavailable on my server, so it is not possible. Thanks anyway!

Nightborn

  • Administrator
  • Sr. Member
  • *****
  • Posts: 318
  • Karma: +20/-0
    • View Profile
    • Shinobilegends
Re: Backup Script
« Reply #6 on: July 30, 2008, 01:01:30 pm »
 ::) you don't need commandline access... you only need the option to *run* scripts via Perl, you don't need to login to the console for that.

But alright ^^ it's working pretty great currently. Actually one of the first pieces of software that was installed and just worked after a few tweaks Oo
It should be fixed, but it won't be easy and it won't be fast. If you want
to help - wonderful. But keep in mind that it will take months of wading
through the ugliest code we have in the tree. If you've got a weak stomach -
stay out. I've been there and it's not a nice place.

   - Al Viro

Boofo131

  • Guest
Re: Backup Script
« Reply #7 on: August 14, 2008, 12:57:41 am »
Just curious here... why did you rewrite it in Perl? I have been using a PHP one for a few years and it still works great.

Nightborn

  • Administrator
  • Sr. Member
  • *****
  • Posts: 318
  • Karma: +20/-0
    • View Profile
    • Shinobilegends
Re: Backup Script
« Reply #8 on: August 14, 2008, 06:12:37 am »
php cannot access ftp directly -> no error messages if the FTP fails

perl is closer to the shell -> no system("") stuff

in perl I can rerout STDOUT and STDERR with ease, in php not

etc
It should be fixed, but it won't be easy and it won't be fast. If you want
to help - wonderful. But keep in mind that it will take months of wading
through the ugliest code we have in the tree. If you've got a weak stomach -
stay out. I've been there and it's not a nice place.

   - Al Viro