Gossamer Forum
Home : General : Perl Programming :

Backing up a folder without SSH...

Quote Reply
Backing up a folder without SSH...
Just thought I would share this bit of code;

Code:
#!/usr/local/bin/perl

print "Content-type: text/html \n\n";
print "System: $ENV{'DOCUMENT_ROOT'}";

chdir('/full/path/to/folder');

system("tar -cvvf backup.tar ./");
print "DONE!";

Basically, this will create a backup.tar file for you, which holds the contents of the above folder (permissions should be kept too).

The sole reason for writing this script, was due to the fact that I needed a simple script to backup a clients site; and then get it ready for a transfer to another server (the old server didn't have SSH, but the new one does).

Anyway... for anyone who finds this post useful... enjoy =)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!