+ 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
    Location
    Harpenden
    Posts
    2,262
    Thank Post
    51
    Thanked 276 Times in 214 Posts
    Blog Entries
    6
    Rep Power
    113

    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.

    Cheers,

    Norphy

  2. #2

    unixman_again's Avatar
    Join Date
    Nov 2011
    Posts
    695
    Thank Post
    26
    Thanked 138 Times in 105 Posts
    Rep Power
    134
    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
    Location
    United Kingdom
    Posts
    47
    Thank Post
    1
    Thanked 12 Times in 12 Posts
    Rep Power
    7
    Just as I was doing this today, the manual alternative is to use (Apple) Remote Desktop.

    Select all machines.
    Manage->Send Unix Command.
    Code:
    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

SHARE:
+ 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
  •