LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 01-27-2009, 01:52 PM   #1
HyperTrey
Member
 
Registered: Sep 2006
Posts: 127

Rep: Reputation: 15
Question Having a perl or bash file run without logging in


I know Macs are based on BSD so I am asking this question here.

I have 2 sets of machines. First set is the obvious windows PCs and the other is Macs. What we do on the windows units, dump a ghost image onto the machine and then use a series of batch files to move files, set users and to join the active directory. On the Macs we do everything by hand and it takes a LONG time to do alot of them at once.

What I want to know is how do how to get the Macs (BSD) to run a file, such as bash or perl, to update the OS and add to Active directory without having to log into the mac? So after the image is dumped onto the machine, it should run:

/usr/local/bin/ktcheck -c sha1 -h <server>

/usr/local/bin/fsdiff -A -c sha1 /|/usr/local/bin/lapply -h <server>

and then Join it to the active directory. Using a master script. And the other question would be on the second one (which takes about 2 hours) how to show progress if the first question is capable.

How do I go about accomplishing these two?
 
Old 01-28-2009, 08:12 AM   #2
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629

Rep: Reputation: Disabled
If you know the command line commands you can use cron.

To make commands depend on the successful completion of a previous job you just concatenate the jobs like so "job1&&job2&&...&&jobn".
 
Old 01-28-2009, 08:13 AM   #3
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629

Rep: Reputation: Disabled
<inadvertent double post deleted>
 
Old 01-28-2009, 08:15 AM   #4
HyperTrey
Member
 
Registered: Sep 2006
Posts: 127

Original Poster
Rep: Reputation: 15
this will allow to run once then delete the job so it does not run again? I only want the script to run at setup.
 
Old 01-28-2009, 08:19 AM   #5
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629

Rep: Reputation: Disabled
Depends from how you set up cron. I (mis?)-understood that you want to do this periodically. Else you simply issue the concatenated jobs from the command line. But maybe I just didn't get what you really want to do...
 
Old 01-28-2009, 10:48 AM   #6
HyperTrey
Member
 
Registered: Sep 2006
Posts: 127

Original Poster
Rep: Reputation: 15
basically I want when the machine restarts the first time, it will run 2 commands on its on and join AD without ever having anyone entering in the command. It will do it once and that is it.
 
Old 01-28-2009, 10:56 AM   #7
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629

Rep: Reputation: Disabled
Sure. Use cron with the @reboot option.
http://linux.die.net/man/5/crontab
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help with perl/bash script to parse PicBasic file cmfarley19 Programming 13 11-18-2004 05:06 PM
Perl or Bash Mass File Edit redneon Programming 1 10-14-2004 11:43 AM
How to Run perl scripts using bash Boudewijn Linux - Software 2 11-26-2003 03:37 AM
How to run a bash command in the background from perl script professorfrink Programming 3 11-13-2003 03:02 PM
perl(Cwd) perl(File::Basename) perl(File::Copy) perl(strict)....What are those? Baldorg Linux - Software 1 11-09-2003 08:09 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 04:45 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration