lots of tech info here

Copy specified directories from one location to another

Published on 06 March 2010 | No Comments

Copy specified directories under /apps/tools


#/usr/bin/perl

# TITLE       : Copy specified directories under /apps/tools
# DESCRIPTION : This script is a very basic Perl script that copies
#                all specified directories from PRODUCTION1.com to PRODUCTION2.com
# CREATED     : Arul John May 2007
# MODIFIED    : Arul John May 2009
# NOTES
# 0. Create an ssh password-less connection as described in http://aruljohn.com/info/sshwithoutpassword/
# 1. Login to PRODUCTION2.com
# 2. Copy this script to PRODUCTION2.com and run it from the directory where you want the copied directories

# Variables
my $directories_in_prod = <> $dir EXISTS... not copying";
    } else {
        print "++ $dir - copyingn";
        system('scp -r USER1@PRODUCTION1.com:/apps/tools/'.$dir.' .');
    }
}

# Goodbye
print "n # Goodbyen";
exit;

Created on 06 March 2010

If you liked this article, follow us on Facebook and Twitter (@aruljohn).

Share this with Others

Subscribe

Tags