Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Lightscap3s

macrumors newbie
Original poster
Mar 14, 2018
3
0
Carmel, IN
Hello,

I'm not real sure if this is the correct form, but if it isn't please let me know wheres the correct form.

I'm in need of someone to write me quick and simple Apple Script, and I'm even willing to pay a few bucks via ApplePay text message or PayPal.

- Otis
 

Lightscap3s

macrumors newbie
Original poster
Mar 14, 2018
3
0
Carmel, IN
What do you want it to do, and does it strictly have to be an Apple Script, or can it be bash too?

Yes, they need to be scripts for them to work through an application called ChronoSync.

Essentially, the first script will run on a particular directory that has folders with a file in each folder. The script should permanently delete (purge) all folders and it’s contents that have created dates more than two days old from the current time and date the script is executed - always keeping the original directory folder path in place.

The second script will run on different folder that has folders with a file in each folder. This script should permanently delete (purge) all folders and it’s contents, but KEEP the folder and contents with the most recent created date of everything in that particular folder at the time - always keeping the original directory folder path in place.
 

casperes1996

macrumors 604
Jan 26, 2014
7,503
5,679
Horsens, Denmark
I wasn't suggesting not to use scripts. Just to use bash scripts instead of Apple Script scripts. Regardless, what's the purpose of ChronoSync in this case? Just to tick the timer? Because then what I'd personally do instead, is to set up a crontab with bash
 

Lightscap3s

macrumors newbie
Original poster
Mar 14, 2018
3
0
Carmel, IN
I wasn't suggesting not to use scripts. Just to use bash scripts instead of Apple Script scripts. Regardless, what's the purpose of ChronoSync in this case? Just to tick the timer? Because then what I'd personally do instead, is to set up a crontab with bash
It's an application for syncing and backing up files with a ton and functions and setup options, but none that fits my particular need for this syncing and backup effort. It allows for Apple Scripts to be ran before and after a sync.
 

NoBoMac

Moderator
Staff member
Jul 1, 2014
5,874
4,471
First half of the problem is easy-peasy, if understanding the problem.

Code:
cd pathtoparentfolderhere
find -d . -type f -mtime +2 -delete
find -d . -type l -mtime +2 -delete
find -d . -type d -empty -delete

Could probably condense into:

Code:
cd pathtoparentfolderhere
find -d . -type d -mtime +2 -exec /bin/rm -rf {} \;

Second part is similar, but, you will need to play around with using with the "! -newer" switches.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.