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

Go Back   Shirt Pocket Discussions > SuperDuper! > General

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 09-08-2006, 10:10 PM
MacOfTheEast MacOfTheEast is offline
Registered User
 
Join Date: Jul 2006
Location: Dirty Side, USA
Posts: 8
Help with AppleScript - text file from log

Dave,

Remember me?

When you have a free moment (or maybe several) can you provide me with some AppleScript code that will pluck off the bottom 10-20 lines of a log file and write it out to a text file? What I'm hoping to achieve is to be able to add a line to the bottom of your prune_log shell script that will call this routine...

mail -s "Backup Results" me@mydomain.com < /the/file/you/help/me/create.txt

So I need code to insert between on afterRunningCopy() and end afterRunningCopy which will create the text file. The same routine could be called between on errorRunningCopy(errorMsg) and end errorRunningCopy to report a failure.

I think this could end up helping a few people that I've read here that would prefer an email routine containing some useful information as opposed to relying on Growl notifications.

If this is too much to ask of you, no sweat.

Thanks!
MOTE
________
Yamaha CT3

Last edited by MacOfTheEast; 01-19-2011 at 10:05 PM.
Reply With Quote
  #2  
Old 09-09-2006, 10:27 AM
dnanian's Avatar
dnanian dnanian is offline
Administrator
 
Join Date: Apr 2001
Location: Weston, MA
Posts: 14,761
Send a message via AIM to dnanian
You probably want something like (and this is shell):

tail -n 20 /the/path-to-the/log | mail -s "Backup Results" me@mydomain.com
__________________
--Dave Nanian
Reply With Quote
  #3  
Old 09-09-2006, 11:08 AM
MacOfTheEast MacOfTheEast is offline
Registered User
 
Join Date: Jul 2006
Location: Dirty Side, USA
Posts: 8
Quote:
Originally Posted by dnanian View Post
You probably want something like (and this is shell):

tail -n 20 /the/path-to-the/log | mail -s "Backup Results" me@mydomain.com
Yes.. . But I read elsewhere on the forum that you could actually obtain the path and the name of the logfile from within the run script so I thought grabbing it there would be the best choice. Can you please provide an example of how the routine could be incorporated within the "on afterRunningCopy()" block? Of course, you know what I'm trying to achieve.

Thanks,
MOTE
________
volcano vaporizer review

Last edited by MacOfTheEast; 01-19-2011 at 10:05 PM.
Reply With Quote
  #4  
Old 09-09-2006, 11:33 AM
dnanian's Avatar
dnanian dnanian is offline
Administrator
 
Join Date: Apr 2001
Location: Weston, MA
Posts: 14,761
Send a message via AIM to dnanian
The script itself is a really good example of this, MOTE. Take a look at how it locates the settings, and use the same technique to locate the log...
__________________
--Dave Nanian
Reply With Quote
  #5  
Old 09-09-2006, 11:46 AM
MacOfTheEast MacOfTheEast is offline
Registered User
 
Join Date: Jul 2006
Location: Dirty Side, USA
Posts: 8
Quote:
Originally Posted by dnanian View Post
The script itself is a really good example of this, MOTE. Take a look at how it locates the settings, and use the same technique to locate the log...
Will do, Dave. I'll come back later with either the solution or some more questions.

Thank you
________
vaporgenie vaporizer

Last edited by MacOfTheEast; 01-19-2011 at 10:06 PM.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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
How to preserve icon of target volume during smartbackup? mypointofview General 62 12-08-2007 08:18 AM
A strategy for managing SD! jobs via AppleScript Syzygies General 15 05-01-2006 08:55 AM
Problems with SD fdwlaw General 8 01-15-2006 11:58 AM
No such file or directory jjg General 7 05-06-2005 03:07 PM
File Preventing Successful Backup michael k General 4 03-18-2005 11:02 AM


All times are GMT -4. The time now is 08:24 PM.


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