+ Post New Thread
Results 1 to 3 of 3
Mac Thread, Setting up a scheduled task using a bash script in Technical; Is there a simple way of setting up a scheduled task on a Mac via the command line or a ...
  1. #1

    Norphy's Avatar
    Join Date
    Jan 2006
    Thank Post
    Thanked 333 Times in 259 Posts
    Blog Entries
    Rep Power

    Setting up a scheduled task using a bash script

    Is there a simple way of setting up a scheduled task on a Mac via the command line or a Bash script?

    Reason I ask is, since we've moved to Mavericks our Macs have a very annoying habit of buggering up their disk permissions. Only admin users have permission to access the /Applications folder. This means that all standard users see is a long line of question marks along the dock and they can't run any other apps either.

    Going into the disk utility and running Repair Permissions fixes this as does opening a terminal session and running "diskutil repairPermissions /" from a terminal session.

    So what I'd like to is to set up a scheduled task via a bash script to run "diskutil repairPermissions /" every Monday morning at 9.00 and to run the task if it gets missed because the machine is off. I don't care if it uses cron or launchd just so long as it works! I've tried looking online but I find the documentation for both to be inscrutable.



  2. #2

    unixman_again's Avatar
    Join Date
    Nov 2011
    Thank Post
    Thanked 155 Times in 117 Posts
    Rep Power
    I think you need anacron for this. However, if you have Leopard and beyond "Leopard launchd will run skipped jobs when the machine is next awake." YMMV as I have not tested it actually does.

  3. #3

    Join Date
    Mar 2012
    United Kingdom
    Thank Post
    Thanked 13 Times in 13 Posts
    Rep Power
    Just as I was doing this today, the manual alternative is to use (Apple) Remote Desktop.

    Select all machines.
    Manage->Send Unix Command.
    diskutil repairPermissions /
    (or use the template)->Send
    Once it's in your history you can just click retry.

    It tells you if it succeeds or not

+ Post New Thread

Similar Threads

  1. [Ubuntu] Setting up an RTMP server using nginx
    By NerdNamedMatt in forum *nix
    Replies: 0
    Last Post: 22nd January 2014, 10:51 AM
  2. Replies: 3
    Last Post: 20th December 2013, 08:56 AM
  3. Setting up computers for Exam use
    By sbutterworthtj in forum How do you do....it?
    Replies: 5
    Last Post: 7th January 2009, 03:03 PM
  4. Setting up a web server for pupils' use
    By park_bench in forum Web Development
    Replies: 14
    Last Post: 9th April 2008, 10:16 AM
  5. Setting up NAT using IPTABLES
    By ChrisH in forum *nix
    Replies: 23
    Last Post: 9th November 2005, 01:54 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts