Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7561249
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T13:06:56+00:00 2026-05-30T13:06:56+00:00

My working command to run regular backups: ditto -c -k –sequesterRsrc –keepParent ~/Library/’Application Support/MyProg’/

  • 0

My working command to run regular backups:

 ditto -c -k --sequesterRsrc --keepParent ~/Library/'Application Support/MyProg'/ ~/Dropbox/'Application Support/MyProg'/`date "+MP_backup_%Y-%m-%d_%H%M%S"`.zip

This creates a nice file: MP_backup_2012-02-21_133445.zip. But I want to structure this script and provide a nice growl notification when complete. How would i extract the generated filename and provide a nice growl notification like “Backup succesfully complete. Backed up at MP_backup_2012-02-21_133445.zip”

My code/pseudocode goes something like this:

 ## Set the Backup path ##
 BKP="~/Dropbox/Application Support/MyProg"

 ## Set KM Source path ##
 SRC="~/Library/Application\ Support/MyProg/"

 # Creat a zipped bkup with dated suffix
 ditto -c -k --sequesterRsrc --keepParent "$SRC" "$BAK/`date "+MP_backup_%Y-%m-%d_%H%M%S"`.zip

 ## Growl a message saying the the File name is successfully created, if created else throw error ##

 if [ <backup created> ] 
  then
    growl/echo "Backup succesfully complete. Backed up at MP_backup_2012-02-21_133445.zip"
  else 
    echo "Me no find Backup FAIL!"
   fi 

Would greatly appreciate guidance in converting above pseudocode to beautiful glorious working code.

Cheers.

Thanks peeps, info from all provided answers were used to come up with the below final working solution:

## Set the Backup path ##
bkp="Dropbox/Application Support/My Prog"

## Set KM Source path ##
src="Library/Application Support/My Prog"

## Preferred Date Suffix ##
filename=$(date +"MP_backup_%Y-%m-%d_%H%M%S.zip")

# Creat a zipped bkup with dated suffix
ditto -c -k --sequesterRsrc --keepParent ~/"$src"/ ~/"$bkp"/"$filename"

## Growl the File name is successfully created ##
if [ -f ~/"$bkp"/"$filename" ]
  then
    echo "Backup successfully complete. Backed up at ~/$bkp/$filename";
  else 
    echo "Me no find Backup FAIL!";
fi 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T13:06:57+00:00Added an answer on May 30, 2026 at 1:06 pm

    Generate the filename separately and store it in a variable, so you can use that variable elsewhere:

    filename="$BAK/`date "+MP_backup_%Y-%m-%d_%H%M%S"`.zip
    ditto -c -k --sequesterRsrc --keepParent "$SRC" "$filename"
    
    ...
    
    growl/echo "Backup succesfully complete. Backed up at $filename"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to run my Silverlight tests via a command line (eventually MSBuild) working
I'm working on a command line application for Solaris, written in Java6. I'd like
I am working on an application an have an issue about running shell command
I'm working on creating a single command that will run mulitple things on the
I am working on a command-line tool which would run the method - [NSMutableDictionary
Problem: to get the command working here. My domain is http://cs.edu.com/user/share_dir , but I
This unix command I haven't got quite working on Mac yet - any ideas
I am working on a C++ based command line tool and I want to
cd is the shell command to change the working directory. How do I change
Has anyone tried out working with the Delete and update command of SPDataSource used

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.