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


IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work!
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates