UNIX command to set time

I'm looking for a UNIX command to set each client machine to use a network time server to obtain the correct time. Any help would be appreciated. Thank you.

systemsetup -getusingnetworktime
Display whether network time is on or off.
systemsetup -setusingnetworktime<on off>
Set using network time to either <on> or <off>.
systemsetup -getnetworktimeserver
Display network time server.
systemsetup -setnetworktimeserver <timeserver>
Set network time server to <timeserver>.

Similar Messages

  • UNIX command to set permissions for a "public" partition?

    I have a bunch of Core Duo (1.83) iMacs running 10.4.11. We have the drive partitioned so that students can save/store stuff locally for myriad reasons.
    With infrequent regularity, the read/write permissions on the partition get munged up and staff have to reset permissions (using the Get Info window).
    I would DEARLY love to use ARD 3.2 to send a UNIX command to set permissions so that EVERYONE has access to EVERYTHING on the partition regardless of who has logged in. We have cleverly named this partition "Scratch" 'cuz, well, you know, that's what scratch drives are for, yes?

    What I was hoping for was the ACTUAL chmod command so that I could just cut and paste it.
    Sorry not to be sufficiently specific. If you'd said that initially, I could have provided a more direct answer. I didn't know if you were even aware of chmod, and lots of people when they learn about it don't want to go anywhere near a chmod command, so I posted only to the general description first so you knew what you were getting into. Templeton has you covered for the specific command.
    For future questions, the more specific you can be about what you're aware of/have tried and what it is you're looking for, the more precise folks here can be in their answers.
    Regards.

  • Command line set time

    My kid's iMac doesn't check the time very often even though it is set to do so automatically. Back when I was on linux I could write a little shell program to get the correct time off the network and set the computer's clock and then put the program in crontab. I'd like to do this for his computer but don't know
    how. Thanks, Steve

    Maybe it doesn't check the time because of the
    firewall? If the firewall is turned on in System
    Preference > Sharing, check "Allow: Network Time".
    Got it! Thanks. Why my computer was set appropriately
    and my son's wasn't, I don't know, but this should fix it.
    (I didn't even know about this setting.)
    Thanks, Steve
    (This solved the problem but didn't answer my question. I'm
    an escapee from Linux. I like command line options (but of
    course don't need it here anymore), in particular, I wish there
    were command line options for iCal.)

  • Unix command to set hot corners up

    Is there one?
    Thanks

    systemsetup -getusingnetworktime
    Display whether network time is on or off.
    systemsetup -setusingnetworktime<on off>
    Set using network time to either <on> or <off>.
    systemsetup -getnetworktimeserver
    Display network time server.
    systemsetup -setnetworktimeserver <timeserver>
    Set network time server to <timeserver>.

  • UNIX command for Energy Saver settings - Set Schedule

    Using ARD 3, can anyone help me with a UNIX command for setting the scheduled sleep and wake times for 10.4 clients?
    Thanks,
    Josh

    Thanks for getting me on the right track, I've been working with pmset for a couple days now and I'm having some problems getting my basic schedule that I'd like to work. I'm hoping for another nudge in the right direction. Here's the scenario:
    I need the computers to wake at 7am on weekdays and to sleep at 3:30pm on weekdays as well. I've also got an addition to make the displays sleep after half an hour of inactivity, Here's what I'm trying.
    pmset repeat wake MTWRF 7:00:00;
    pmset repeat sleep MTWRF 15:30:00;
    systemsetup -setdisplaysleep 30;
    I've been trying to push this out as a batch of commands in a template which would be slick, but the problem I'm having is that the two pmset commands don't get along and whichever one is run last cancels out the other. In the actual System Prefs of the machine I'm sending the commands to, there are the two check boxes for Wake or Power On and the other for Sleep or Power Down but I can't get them both to be checked from my UNIX commands.
    Could anyone please help, I feel like I'm so close!
    Regards,
    Josh

  • Unix security and privacy setting unix command via apple remote desktop

    Could someone guide me on the unix command to set System Preferemces Security & Privacy to xx minutes [see screenshot please] via Apple Remote Desktop.
    https://dl.dropbox.com/u/5485939/osx_screenshots/sys%20pref%20security%20privacy .png
    Thank you,

    Pereference tend to be stored for the computer as a whole
    /Library/Preferences/
    or specifcally for the user
    /Users/USERNAME/Library/Preferences/
    well when I set required password for XX minutes... I see that
    /Users/USERNAME/Library/Preferences/com.apple.screensaver.plist modfication date & time changes to the current time & date... hMMM maybe the setting we want is stored here? Can we test this?
    If I check require password and then do the terminal command:
    defaults read ~/Library/Preferences/com.apple.screensaver
    I see
        askForPassword = 1;
        askForPasswordDelay = 0;
        tokenRemovalAction = 0;
    turn it off
    run the terminal command;
    defaults read ~/Library/Preferences/com.apple.screensaver
    I see:
        askForPassword = 0;
        askForPasswordDelay = 0;
        tokenRemovalAction = 0;
    so I can turn it on with
    defaults write ~/Library/Preferences/com.apple.screensaver askForPassword -bool TRUE
    and I can turn it off with
    defaults write ~/Library/Preferences/com.apple.screensaver askForPassword -bool FALSE
    So if a user is logged into a computer. I could send unix command as current console user.
    defaults write ~/Library/Preferences/com.apple.screensaver askForPassword -bool TRUE
    BUT what if the user is logged out? or there are more then one user on the computer?
    then I could run unix command as user root and send
    defaults write /Users/USERNAME/Library/Preferences/com.apple.screensaver askForPassword -bool TRUE
    (replace USERNAME with the user's short name.)
    but what if I don't know the user name? or names
    send unix command as root
    ls -al /Users/
    get back a list of folders
    bob
    surely
    shares
    and then do
    send unix command as root
    defaults write /Users/bob/Library/Preferences/com.apple.screensaver askForPassword -bool TRUE
    defaults write /Users/surely/Library/Preferences/com.apple.screensaver askForPassword -bool TRUE
    you could also do some thing like
    defaults write ~/Library/Preferences/com.apple.screensaver askForPasswordDelay -integer 5
    if you want to change the period of time to lock to 5 seconds
    or
    defaults write ~/Library/Preferences/com.apple.screensaver askForPasswordDelay -integer 900
    (900 seconds  / 60 seconds = 15 minutes)

  • Can I set 4-bit color depth (16 colors) with a Unix command?

    "M4" by Deadly Games, a Sherman Tank simulator, insists that the color be set to 16 before it will launch completely and run, but the least I can select on my G4 QS 2002 with 9.2.2/10.3.9/10.4.10 is 256 colors. Is there a way to choose fewer colors than 256 using Terminal and a Unix command?
    TIA

    Camelot wrote:
    4-bit screen depths have not been supported in a long time. I don't know any option that will get you that setting.
    I can't imagine any current game would require that setting. Even if it only uses 16 colors internally it shouldn't need the entire system to be set that way.
    Can't argue with any of your statements or opinions.
    BTW, do you have an answer/solution to the problem?

  • Can't Set Remote Login OFF via Send Unix Command systemsetup

    Trying to use the System Setup->Remote Login template in ARD to turn off Remote Login (SSH) in Sharing panel of System Preferences on Mac that is administered through Apple Remote Desktop.
    In Apple Remote Desktop (ARD), I select the client machine, then choose "Send Unix Command..." from the "Manage" menu. In resultant window, I pick "System Setup->Remote Login (SSH) from the "Template" drop down box in the upper right. That populates the upper window with Unix commands. I edit/change the "on" to "off" and tell the dialog to Run command as User: root, then click on "Send" button.
    Progress bar goes forever with no change.
    I can turn off Remote Login via ARD by controlling each client machine via an ARD WINDOW, then navigating to the Sharing Preference pane, but that process is tedious when performing for multiple client Macs.
    Strange, but I CAN use the "Send Unix Command..." outlined above to turn ON Remote Login, and get the status of Remote Login ("systemsetup -getremotelogin"). Just can't turn OFF Remote Login (quickly/efficiently).
    man systemsetup suggests I need to write the command as "setremotelogin -f off" but that failed with an improper command syntax error.
    Thoughts?

    It’s waiting for you to type a confirmation. If you run this command on the command line normally, you’ll see the message:
    Do you really want to turn remote login off? If you do, you will lose this connection and can only turn it back on locally at the server (yes/no)?
    Use this command instead:
    systemsetup -f -setremotelogin off

  • Execute Unix command on login

    Hello, is it possible to execute a unix command on user login?
    I want that every time a user login on a mac at my company, a unix command be executed.
    Is this case, this is the command: defaults write com.apple.mail NSPreferredMailCharset "UTF-8"
    thks in advance

    {quote}Loginwindow Scripts
    Another way to run applications at login time is to launch them using a custom shell script. Mac OS X provides two options for launching scripts when the user logs in. When creating your script file, keep the following in mind:
    * The permissions for your script file should include execute privileges for the appropriate users.
    * Scripts launched by loginwindow are run as root. Therefore, you should thoroughly test your scripts before deploying them to make sure they do not adversely affect the user's system.
    *In your script, the variable $1 returns the short name of the user who is logging in.
    * Other login actions wait until your hook finishes executing. Therefore, have your script do what it needs to do quickly and then exit. {quote}
    I want the script to be run as the current user that does the login, and not as the root. I think that if its run as root, it changes nothing in the user. Does this root issue apllies to the Zerwas method?
    It depends on how Zerwas was thinking you'd implement it. If you added it to each user's login items, it should run as the user. If you create a startup item to run it, it will run as root. I'm assuming Zerwas was suggesting the former because there would be no point in wrapping the shell script in an AppleScript if you are going to turn it into a startup item.
    What you might be able to do - at least with the loginwindow script - would be to explicitly run the command as the user by making use of the fact that the user name is passed to the loginwindow script as $1. I've never used loginwindow scripts but it seems as though it should work.
    Another possibility would be to use a LaunchAgent. These are really intended to manage background processes, though, and it seems an unnecessary use of resources to load one which will only ever be run at startup.
    Can I ask why you wish to run the script every time a user logs in? Is the concern that the default will get set to something else and needs to be reset regularly?
    - cfr

  • Is there an ARD command or Unix command that I can send to reset the desktop background image to default?

    I was forced to create a local user with an automatic login on all of the machines in the building. I listed off many various issues that could come arise by doing this but was tuned out. Now people are changing all of the desktop backgrounds to some pretty inappropriate images. I forewarned the person ordering this that this may be one of the many issues that would arise when doing away with our server based logins, and now I am charged with fixing every desktop every time someone changes it to something inappropriate.
    Is that an Apple Remote Desktop command or a Unix command that I can send through ARD v3.5.3 to the machines to reset the desktop background image to the default Aqua Blue jpeg image located in the /MacintoshHD/Library/Desktop\ Pictures/Aqua\ Blue.jpg.
    The machines that I am dealing with have OS X 10.4.11, OS X 10.5.8, OS X 10.6.8, and OS X 10.7.4 installed on them, but the OS X 10.4.11 machines are the ones that are creating the biggest issue so I would like to deal with those first.

    Ya, I'd love to have the computers connected to the Xserver, unfortunately against my heeding, I was ordered to take them off of the Xserver, so they only have a local account that automatically logs in on startup, and even though I have Parental Controls set, I can not stop them from going to Safari, selecting an inappropriate image and setting it as the background, so now I’ve been ordered to fix all of the backgrounds that people are messing with.
    My Xserver is running OS X 10.4.11 Server Edition. Yes, I would love a new server, but that’s not happening due to budget cuts.
    So what I am hoping for is a command that I can put into Apple Remote Desktop v3.5.3 and push out to all of the computers via its Unix commands and reset all the desktops to their default image.

  • Setting time or time server on clients with ARD

    Does anyone know what files need to be copied to OS X clients to set their time or time server? I know that time server info is stored in /etc/ntp.conf, but this isn't the only file that needs to be sent to set up a client to get its time from a time server. I haven't been able to find the correct .plist file that includes these settings and am not familiar enough with UNIX to know which other files are used for these settings.
    Thank you,
    Peggy

    Using the ARD Send Unix Command option send the following command to the workstations:
    systemsetup -settime <hh:mm:ss>
    where <hh:mm:ss> is the time you want the systems to have (don't include the brackets). Send the command as the root user (enter root in "send command as:")
    To set the time server to use, send:
    systemsetup -setnetworktimeserver <timeserver>
    substituting the domain name of the time server (again, no brackets).
    For more such commands, in Terminal enter:
    /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Support/netw orksetup -help
    /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Support/syst emsetup -help
    or from within the Remote Desktop Admin in the Send Unix Command window type:
    networksetup -help
    systemsetup -help
    Regards.

  • Unix command from pl/sql

    How can I call a unix command or run a c program
    from a stored procedure in oracle 9i.

    Or if you want to do a host call then implement the following class as a Java stored procedure.
    import oracle.jdbc.*;
    public class util
    // Executes an operating system command. The command shall be fully qualified.
    // The Java connects with silent login. No environment set-up files are run
    // and no path is set. The mode can be "sync" or "async" for respectively
    // synchronous and asynchronous execution
    static public int OSCmd(String cmd, String mode, String[] output)
    throws IOException, InterruptedException
    System.out.println("OSCmd "+cmd+" ("+mode+")");
    output[0]="";
    // start command
    Process proc = Runtime.getRuntime().exec(cmd);
    if (mode.equals("sync"))
    // get command's stdout and stderr
    InputStream stdout = proc.getInputStream();
    InputStream stderr = proc.getErrorStream();
    String str;
    // Stdout
    BufferedReader br = new BufferedReader(new InputStreamReader(stdout));
    while ((str = br.readLine()) != null)
    output[0]+=str+"\n";
    br.close();
    // Stderr
    br = new BufferedReader(new InputStreamReader(stderr));
    while ((str = br.readLine()) != null)
    output[0]+=str+Long postings are being truncated to ~1 kB at this time.

  • ARD Unix Command install with root

    I'm a bit of a unix novice, I am trying to install a script file, 'install.sh', via ARD. Works fine in Terminal locally but I can't work out how to input the root password via the ARD unix command tool.
    cd Desktop
    chmod +x install.sh
    ./install.sh -i
    & set to run command as Root.
    I'm getting seemingly nonsense errors e.g. 'Error 127 sh: line 1: cd: Desktop: No such File or Directory' when the file is definitely there, on the desktop.
    I'm pretty sure it needs to enter the root pw in the code window, can anyone advise please?

    when you say install.sh is on the desktop of the remote computer. Is that the desktop for account root? Or is that the desktop of the current logged in users? (assuming the currently logged in user is not root)
    when you run a command as root you start at "/var/root/" there is only going to be a folder /var/root/desktop/, if you've used the login window at least ones to log into root.
    if the current user logged into the remote computer is another account, then your install.sh resides in another location. Witch will look some thing like this. /Users/nameOfUser/Desktop/install.sh
    try this. Send the command:
    cd Desktop
    pwd
    send the command first as the current logged in user, then as root. When you run it the first time, you should get some thing like  /Users/nameOfUser/Desktop/
    when you run it as root you'll probable see /var/root/.
    if you do then you would probable want to do some thing like
    chmod +x /Users/nameOfUser/Desktop/install.sh
    /Users/nameOfUser/Desktop/install.sh -i

  • Unix command to click button on dialog box and close windows?

    I administer an elementary school computer lab of 35 eMacs all with OS 10.4.7 and with ARD 3.0. Our network server configuration requires a mounted server on each desktop in order to administer certain software packages we use. Every morning at start-up I have to walk around and manually click "Connect" on the dialog boxes. Then, with this configuration, each time a server is mounted, it opens up a Finder Window on the host machine so I've got to walk around and close windows on all the machines. I'm sure there must be an AppleScript or Unix command that I can set up to do these two tasks but I've not found it (or learned how to write it) in a few days of searching. Any suggestions?
    Thanks,
    Dan

    OK guys,
    I just succeeded in saving the AppleScript command as an application. I put it in the Login Items just after the servers. It worked beautifully! No more open windows exposing sensitive files to the risks of elementary students (how come the mounted volumes always appear on the desktop even when the "hide" button is checked?). It would be great if the mounted volumes were not showing at least in a setting like a school computer lab.
    Now, I'm still dealing with the mounting process requiring me to manually click on "Connect" every time. The Student account doesn't even have a password just to make such things easier. Still the process displays this:
    (Oh well, I guess I can't insert a ScreenShot.)
    Here's what it says: Connect to the file server "server name."
    Connect as: Registered User
    Name: "account name"
    √Remember password in keychain
    (and then two buttons) Cancel or Connect
    That's where I'm at right now. My district Tech. Support folks say that there's no way to avoid the dialog box but John seems to do it OK. They also pointed me to an online source (www.bombich.com) that I haven't yet checked out.
    Thanks again,
    Dan

  • Unix Command to Move Folders back into Directory

    As you can see from my previous thread: https://discussions.apple.com/thread/3138884?tstart=0
    I ended up reinstalling Mac OS X 10.6.0 after using "mkdir" and "mv" Unix commands to move my old files to a "previous" folder and I'm still trying to access my account because it's Vile Vault protected. I wish I knew how to move my old folders out from previous into /volumes/macintosh\ HD
    Basically it looks like this right now
    ~/Volumes/Macintosh/HD\ Previous (I'm not even sure if that's written the right way
    I need to move all of the folders out from Previous into ~/Volumes/Macintosh\ HD and deleting the existing ones in it.
    All I want to do is have my old Kernel Panic back because I know how to fix it now.
    Thank you very much!

    Hi Philip
    Philip Han wrote:
    I honestly despise the forum setup... Whenever I wait too long the cursor loses focus so when I hit backspace I go back a page and lose everything I wrote. This has happened to me on 3 different computers now.
    I don't have this problem at all, and I can't make any suggestions on how to fix it.  Maybe you should post a separate thread in the Using the Forums Forum.
    So in the end I went against your advice and moved Applications and Users back to their original folder in HD and I logged in just fine! Well, I did have to boot into single user mode to restore Admin Privileges by creating a new account and then changing Privileges. Some programs didn't start up but it's okay, I know which ones rely on System and whatnot but at least I have nearly everything in its original place and I can back it all up.
    Ahh, you're made of sterner stuff than me !
    Best Buy has $99 1TB WD Passport SE's (The USB 3.0 Version actually!) so I grabbed one immediately and set up Time Machine.
    Sounds like a good choice. 
    Seriously, what other way can you ensure that your data is safe without using File Vault? I use Truecrypt for some things that I don't access much, but daily operations? I'd rather just put up with the sluggish performance of FV!
    I think it depends on what level of security you need. Do you routinely have files that simply must not be read by a third party if your computer gets stolen? 
    FV has always struck me as a hammer to crack a nut, and if something goes wrong you can't even take the disk to a data recovery specialist to get your information back.
    On occasions when I have data that must be kept secure I use Disk Utility to set up an encrypted sparse bundle, which I keep on the desktop. When I need to access files in the bundle then I double click on it and enter the password to mount it.  A minor problem with this is that TM will copy across the whole sparse bundle even if just one file on it is edited. Even so, it's not really a problem since TM is working in the background.
    Thank you for all your help Bob!
    You're most welcome
    Bob

Maybe you are looking for

  • Summary Report For Store Activities.

    Dear Gurus.. I need to make a summary report on Store Activities. Having following Fields. Material number |  Material Description |  Material Unit | Opening Balance | Quantity |  Receipts | Quantity | Issues | Quantity | Closing Balance | Quantity |

  • Adobe Document Services Error : 405 - Method Not Allowed

         Hi guys After Upgrading a JAVA System from NW 7.01 to NW 7.4, I'm experiencing this error when opening url http://server:port/AdobeDocumentServices/Config Error: com.sap.engine.services.webservices.espbase.server.additions.wsa.WSAddressingExcept

  • ABAP OO example

    Any ABAP OO documents available having example code ?

  • Dynamic pages - what to look up

    Hi, I am trying to work out how to create a WPF page, which the content changes depending on a button click, one example if the log in button. Once logged in I would like to present different content but without opening a new window. I am unsure what

  • SDM Deploy Error

    Hello! I'm deploying a J2EE project and the J2EE Server gives me the following error : 18-may-2005 14:02:06 /userOut/deploy (com.sap.ide.eclipse.sdm.threading.DeployThreadManager) [Thread[Deploy Thread,5,main]] ERROR: [005]Deployment aborted Settings