Permalink
Browse files

Better outputting across a few programs

  • Loading branch information...
1 parent 6bc1c65 commit af0adcd8bda8f0d72cc32b55359414602566d261 @chilts committed Jul 7, 2012
Showing with 12 additions and 1 deletion.
  1. +2 −0 bin/amazon-s3-sync-down.js
  2. +3 −1 bin/amazon-s3-upload.js
  3. +7 −0 lib/amazon-s3-common.js
@@ -168,6 +168,8 @@ function downloadItem(item, callback) {
ObjectName : item.Key,
};
+ fmt.field('Downloading', item.Key);
+
tmp.file({ template : '/tmp/tmp-XXXXXXXX.' + process.pid }, function(err, tmpfile, fd) {
if ( err ) {
fmt.field('TmpFileError', err);
View
@@ -44,6 +44,8 @@ if ( argv.d || argv.debug ) {
console.log( '- Bucket : ', argv.bucket);
console.log( '- Filename : ', argv.filename);
console.log();
+console.log(argv);
+console.log();
// --------------------------------------------------------------------------------------------------------------------
@@ -57,7 +59,7 @@ fs.stat(argv.filename, function(err, file_info) {
console.log('- uid : ', file_info.uid);
console.log('- gid : ', file_info.gid);
console.log('- inode : ', file_info.ino);
- console.log('- ctima : ', file_info.ctime);
+ console.log('- ctime : ', file_info.ctime);
console.log('- mtime : ', file_info.mtime);
console.log();
View
@@ -14,6 +14,10 @@
//
// --------------------------------------------------------------------------------------------------------------------
+var fmt = require('fmt');
+
+// --------------------------------------------------------------------------------------------------------------------
+
function listObjectsAll(s3, bucketname, callback) {
var items = [];
@@ -25,12 +29,15 @@ function listObjectsAll(s3, bucketname, callback) {
options.Marker = marker;
}
+ fmt.field('Request', options.Marker || '[start]');
s3.ListObjects(options, function(err, data) {
if (err) {
callback(err, null);
return;
}
+ fmt.field('Items', data.Body.ListBucketResult.Contents.length);
+
// loop through all the items and add them on to our saved list
data.Body.ListBucketResult.Contents.forEach(function(v, i) {
// remove the leading '/'

0 comments on commit af0adcd

Please sign in to comment.