How To Copy Top-Level Directory Only Using rsync
Regular Files: rsync -av –no-r –progress /volumes/source/* /volumes/destination/ Dot Files: rsync -av –no-r –progress /volumes/source/.* /volumes/destination/
Regular Files: rsync -av –no-r –progress /volumes/source/* /volumes/destination/ Dot Files: rsync -av –no-r –progress /volumes/source/.* /volumes/destination/
Today AWS announced the ability to copy EBS snapshots to other regions, with the ability to copy AMIs coming soon. This is a HUGE improvement, and one that will allow IT architects to create automated DR solutions across AWS regions providing significant resilience against outages. Dear Amazon EC2 Customer, We are delighted to announce the […]
1. You need Ruby, rubygems and the right_aws gem. yum install ruby rubygems gem update –system gem install right_aws 2. Replace any values inside curly braces {} below with real values and remove the curly braces. YMMV
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
require 'rubygems' require 'right_aws' S3ID = "{S3 ID GOES HERE}" S3KEY = "{S3 KEY GOES HERE}" SRCBUCKET = "{your-s3-bucket-1}" DESTBUCKET = "{your-s3-bucket-2}" s3 = RightAws::S3Interface.new(S3ID, S3KEY) s3.incrementally_list_bucket(SRCBUCKET) do |h| h[:contents].each do |o| puts('Copying ' + o[:key]) s3.copy(SRCBUCKET, o[:key], DESTBUCKET, o[:key]) end end puts('Done.') |
Safely move a file in PHP:
1 2 3 |
if (copy("/your/source/file","/your/destination/newfile")) { unlink("/your/source/file"); } |
wget -m ftp://login:password@yourServer/the/path/
1 2 |
CREATE TABLE newTable LIKE oldTable; INSERT INTO newTable SELECT * FROM oldTable; |
1 |
INSERT INTO newtable (`name`, `address1`, `address2`, `city`, `state`, `zip`, `phone`) SELECT `name`, `address1`, `address2`, `city`, `state`, `zip`, `phone` FROM oldtable; |