• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: AppleScript to erase one mounted volume if it's modification date is date is greater than one day?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AppleScript to erase one mounted volume if it's modification date is date is greater than one day?


  • Subject: Re: AppleScript to erase one mounted volume if it's modification date is date is greater than one day?
  • From: 2551 <email@hidden>
  • Date: Sat, 22 Jun 2013 17:40:55 +0700

Using 

stat -f "%m%t%Sm %N" /Volumes/Temporary\ Drive/tmp/* | sort -rn | head -1

returns the last file to be modified and its date. That looks like an ideal candidate to go in Kaydell's script to compare against the current time. 

:)


Best

Phil
http://applehelpwriter.com

On 21 Jun 2013, at 03:22, Jim Kessler <email@hidden> wrote:

Here's the scenario: a Mac with a hard drive is partitioned into two volumes, one of which is the startup drive (Macintosh HD). The second volume (Temporary Drive) holds data files which are non-critical. I'd like to compose an AppleScript that compares (running at startup, through a login item) the current date to the modification date of the second volume, and erases the second volume if the modification date is more than a day (or 24 hours, or whatever measure of time necessary) older than the current date. Is this easily accomplished through AppleScript? (Running 10.8.4.)

Thanks!
Jim


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: AppleScript to erase one mounted volume if it's modification date is date is greater than one day?
      • From: 2551 <email@hidden>
References: 
 >AppleScript to erase one mounted volume if it's modification date is date is greater than one day? (From: Jim Kessler <email@hidden>)
 >Re: AppleScript to erase one mounted volume if it's modification date is date is greater than one day? (From: Kaydell Leavitt <email@hidden>)
 >Re: AppleScript to erase one mounted volume if it's modification date is date is greater than one day? (From: "koenig.yvan" <email@hidden>)
 >Re: AppleScript to erase one mounted volume if it's modification date is date is greater than one day? (From: 2551 <email@hidden>)
 >Re: AppleScript to erase one mounted volume if it's modification date is date is greater than one day? (From: Kaydell Leavitt <email@hidden>)
 >Re: AppleScript to erase one mounted volume if it's modification date is date is greater than one day? (From: 2551 <email@hidden>)
 >Re: AppleScript to erase one mounted volume if it's modification date is date is greater than one day? (From: Kaydell Leavitt <email@hidden>)
 >Re: AppleScript to erase one mounted volume if it's modification date is date is greater than one day? (From: Brian Christmas <email@hidden>)
 >Re: AppleScript to erase one mounted volume if it's modification date is date is greater than one day? (From: Kaydell Leavitt <email@hidden>)
 >Re: AppleScript to erase one mounted volume if it's modification date is date is greater than one day? (From: 2551 <email@hidden>)

  • Prev by Date: Re: AppleScript to erase one mounted volume if it's modification date is date is greater than one day?
  • Next by Date: re: Re: AppleScript to erase one mounted volume if it's…
  • Previous by thread: Re: AppleScript to erase one mounted volume if it's modification date is date is greater than one day?
  • Next by thread: Re: AppleScript to erase one mounted volume if it's modification date is date is greater than one day?
  • Index(es):
    • Date
    • Thread