Shirt Pocket Discussions  
    Home netTunes launchTunes SuperDuper! Buy Now Support Discussions About Shirt Pocket    

Go Back   Shirt Pocket Discussions > SuperDuper! > General
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 03-27-2009, 07:12 PM
bobm bobm is offline
Registered User
 
Join Date: Oct 2007
Posts: 4
Touch a file after backup

Anybody have any suggestions on how to touch a file (the unix command) so that I can look at the backup disk and see when the last backup was done?

I'm now trying to rotate between 2 different backup disks and it would be nice if I could do something like:

> date >last_bkup.txt

put somehow target the backup drive root.

thx
Reply With Quote
  #2  
Old 03-27-2009, 07:45 PM
dnanian's Avatar
dnanian dnanian is offline
Administrator
 
Join Date: Apr 2001
Location: Weston, MA
Posts: 14,923
Send a message via AIM to dnanian
You can do that with an after-copy shell script, no?
__________________
--Dave Nanian
Reply With Quote
  #3  
Old 03-28-2009, 12:23 AM
bobm bobm is offline
Registered User
 
Join Date: Oct 2007
Posts: 4
I pondered that.. Of course you reply forced me to read the manual and I found this buried deep down:

43


When SuperDuper executes the script, it passes it six parameters:
1 The name of the source volume (e.g. Macintosh HD)
2 The mount path of the source volume (e.g. /)
3 The name of the destination volume (e.g. Sandbox)
4 The path of the destination (e.g. /Volumes/Sandbox)
5 The name of the script the user selected (e.g. Copy – all files)


6 The name of the image file being processed, if any. This could be either
a source image (if copying from an image to a volume) or a destination
image (if copying from a volume to an image), or a post-copy image
(selected in the After copy options, below)

so I wrote a simple script to touch a file.

Previously I looked at the manual contents and didn't see anything about how to use the script functionality. It turns out that the Advanced features don't get a link on the manual.

Thanks for the suggestion.
Reply With Quote
  #4  
Old 03-28-2009, 07:34 AM
dnanian's Avatar
dnanian dnanian is offline
Administrator
 
Join Date: Apr 2001
Location: Weston, MA
Posts: 14,923
Send a message via AIM to dnanian
Glad to get you started down the path...
__________________
--Dave Nanian
Reply With Quote
  #5  
Old 03-28-2009, 12:38 PM
jaked.902 jaked.902 is offline
Registered User
 
Join Date: Feb 2009
Posts: 3
Any chance you'd share the script with a not (yet) so unix savvy user?
Thanks
Jake
Reply With Quote
  #6  
Old 03-28-2009, 07:10 PM
bobm bobm is offline
Registered User
 
Join Date: Oct 2007
Posts: 4
Last backup time script

Here is the script, it needs to be chmod'd executable with the following command:

chmod +x script_name

do this from a terminal session. This script will write a file with the filename being the time the last backup completed.

validate the script works on your system with the following command:

perl -wc script_name

enjoy,
bob

--- start script ---
#!/usr/bin/perl -w
use strict;

#
# this script is called after a backup is made, it assumes the following arguments are passed:
#
# When SuperDuper executes the script, it passes it six parameters:
# 1 The name of the source volume (e.g. Macintosh HD)
# 2 The mount path of the source volume (e.g. /)
# 3 The name of the destination volume (e.g. Sandbox)
# 4 The path of the destination (e.g. /Volumes/Sandbox)
# 5 The name of the script the user selected (e.g. Copy – all files)
# 6 The name of the image file being processed, if any. This could be either
# a source image (if copying from an image to a volume) or a destination
# image (if copying from a volume to an image), or a post-copy image
# (selected in the After copy options, below)
#
# we only really care about the path of the destination.
#

# get where we are putting the file
my $outpath = $ARGV[3];

# get what time it is in a string
my $now = localtime;

# make the name of the file == the path (where we backup'd to
# + the current time.
my $fname = "$outpath/$now";

# open the file, complain and exit if it doesn't seem to work.
open( FP, ">", $fname ) or die "Unable to open $fname, $!";;

# just for the heck of write the timestamp to the file
print FP $now;

# close the file and we're done
close FP;

exit 0; # dunno if SuperDuper looks at the exit codes but this is cleaner.

--- end script ---
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
crazy file copy / backup problem nakris General 5 02-16-2009 06:23 PM
Backup fails redarm General 2 06-02-2008 01:30 PM
Backup failure on a certain file bmat General 3 09-25-2007 09:06 AM
(Zero-length) File caused SuperDuper to abort backup alancfrancis General 7 08-31-2005 10:42 AM
File Preventing Successful Backup michael k General 4 03-18-2005 10:02 AM


All times are GMT -4. The time now is 09:01 PM.


Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2024, vBulletin Solutions, Inc.