CRON Jobs
Hello,
I am running a SMB server that I use for centralized file storage as well as a software storage center so that my clients can easily access the software storage center and download software that they see fit. My question is this, I would like to set a cron job to automatically download daily updates to an anti-virus software and possibly push those updates down to the clients. I know it is possible to do the first thing, but the second, I'm not sure about. Someone have any ideas? Thank you. |
Hi Scott,
and yes, the Cron job download is a piece of cake :) The other thing (pushing the files) is quite straightforward, too, if the clients happen to be linux machines. You could set-up a password-less ssh connection for a particular user (like antivir) and then simply scp new_signatures antivir@<target_host>:/<apth>/<to>/<sig> Cheers, Tink |
Hi Tink,
Thanks for the help. Now since I know it's possible, let me go into specifics. The clients are Windows clients (hence my use of smb). I use Norton Anti-Virus on the Windows machines and I would like to automatically retrieve the daily Intelligent updater definitions. I get those from this site: http://securityresponse.symantec.com...es/US-N95.html I download those into a directory called: /software/Norton Definitions Now, as you may or may not know, those updates are daily. Can you tell me what I need to do to set up my linux server to retrieve those updates? The second batch of instructions you gave me are a little harder for me to understand. I've only been working with Linux for less than a year and I'm still learning quite a bit, however, my time is limited now due to my work schedule. Thanks. |
Hummmm :)
I'd go with using a bash-script ... first, download the pages html code from the site using wget, then filter the page for .exe and .zip and use wget again to retrieve them. As for the distribution bits ... I'm not sure about ssh clients for windows, and interaction with linux' ssh passwordless authentication, and as for the time being am not going to read up on it. :} But you could write a little windows.cmd file, store that on the samba server, and use windows' scheduled task feature to run it. Cheers, Tink |
Very interesting,
I knew that there would be a way to do this. . . . However, not to sound stupid, but I've never used WGET before. Can you help me with this? Secondly, you mention filtering out for the .exe and .zip files. Umm, I need some help with this. As I said, I've not been using Linux for more than about 8 months so your patience would be appreciated. Thanks. |
Code:
#!/bin/bash files, but it should work :} Have a play with it. This will dowload all EXE's and ZIP's from that page .... hope this is what you needed? Cheers, Tink |
Yep, that is what I wanted. Thanks a lot!! With that script, at what times will it run or how would I set it to run at a specific time? Tell me, did you write that script out yourself? I've only had one Unix class and our shell scripting segment didn't get nearly that complex. I'm kind of a total novice when it comes to writing shell scripts.
Secondly, and I don't know if you can help with this, but you mentioned setting a scheduled task on the windows machine to run it, however, with that I would have to click on the dialog boxes that appear when the Intelligent Updater is run. Thirdly, what directory would that script have to be located and what should I name the file in order to run? And Fourth, I wish the files to be downloaded to a specific directory, where would I specify the directory to save the files to? |
Quote:
This script is just what's meant to run at a given time that you have to choose yet. Quote:
Quote:
to the General forum mate, this has NOTHING to do with Linux anymore ;) Quote:
you feel like. For cron to be able to run it you'll have to specific the full path to it, anyway. You'll have to chmod u+x <filename> to be able to run it. But if you're doing nifty things like this you really should read up on what you're doing ;) Quote:
probably want to put a cd /<your>/<specific>/<directory> as the second line of that script. Cheers, Tink |
Hi Tink,
You said the second line of this script? So you mean after bin/bash or after wget? #!/bin/bash wget http://securityresponse.symantec.co...ges/US-N95.html for getIt in `awk -F'"' '/=.+\.(zip|exe)\>/ {print $2}' US-N95.html` do wget http://securityresponse.symantec.com/$getIt done Also, let's say I want this script to run at 1700 (5PM) every day. Where would I put that in? And you made a comment about reading up on what I''m doing, where would you suggest doing that? I've only been running LInux for less than a year so that's why my questions probably seem simple to you. |
Hi Scott!
Quote:
add a cd /<your>/<target>/<directory> Quote:
add a line 00 17 * * * /path/to.your/script 2>&1 > /var/log/antivir Quote:
take some time ;) ... http://www.icon.co.za/~psheer/book/ is a pretty good introduction, and there's always the man pages... man man for help on how to use them... If you have questions about cron, for instance, try a man -k cron (alternatively, apropos cron) Cheers, Tink |
I'm sorry, I know you're kidding about the sha-bang line, but I guess I'm a litle slow on the uptake, what did you mean by that?
|
Quote:
! = bang No worries :) ... this is being used in the advanced bash howto (I think?) ... So, #!/bin/bash = the sha-bang line Cheers, Tink |
Hi Tink,
One more question for you if you would be so kind. I was wondering, since my scripting experience is very limited, if you could break down that script and tell me exactly what each command does? I'm just really curious. Secondly, my shell scripting experience, as you can tell, is very limited and I was wondering how I could get better at doing it? Are there books like dummies books that start from the beginning, give good practice excercises, and advance? I was just curious. Anyway, I think later today I will get started on this little project. Thanks again! |
Quote:
Code:
#!/bin/bash <- Tells the shell what "language" to expect, bash-script in this case Quote:
Look at this - either download or read online. http://www.tldp.org/guides.html#abs Also there are "Shell-programming for dummies" books out there. A highly recommendable book as a desktop-reference is O'Reiley's "Linux in a nutshell". Cheers, Tink |
Tink,
I really appreciate all of your help. I thought I was going to be able to get started on this today, but like so many of my days lately, I haven't been able to. See, I work nights and my days are spent mostly in bed and now I'm just getting up and I don't think now is the time to really get started on this project. I guess I'll wait until the weekend. Oh well. . . Hey, if you're ever in the area, look me up. Where are you from anyway? I'd have to guess by your use of language that you're from Austrailia? |
All times are GMT -5. The time now is 12:44 AM. |