Path: utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!virtech!cpcahil From: cpcahil@virtech.uucp (Conor P. Cahill) Newsgroups: comp.sources.wanted Subject: Re: daily backups Keywords: daily backups Message-ID: <1990Feb27.173223.6450@virtech.uucp> Date: 27 Feb 90 17:32:23 GMT References: <118@comspec.UUCP> Reply-To: cpcahil@virtech.UUCP (Conor P. Cahill) Distribution: na Organization: Virtual Technologies Inc., Sterling VA Lines: 33 In article <118@comspec.UUCP> rick@comspec.UUCP (Rick McCalla) writes: >I am trying to write a script that would determine what day of the week it is >and depending on the day perform a specific task. I can't use a crontab entry >as it will be called up by a login process. To be more specific what I am >trying to do is write a script that will backup different areas of the hard >drive to tape determined by what day it is run. Don't know what system you are on, but if you have System V date(1) you can do: "date +%w" which will display the day of the week (0-sunday, etc) Otherwise you can just write a quick and dirty c program that does something like: #include main() { struct tm * localtime(); struct tm * t; long clock; time(&clock); t = localtime(&clock); printf("%d\n", t->tm_wday); } which gets you the day of the week. -- +-----------------------------------------------------------------------+ | Conor P. Cahill uunet!virtech!cpcahil 703-430-9247 ! | Virtual Technologies Inc., P. O. Box 876, Sterling, VA 22170 | +-----------------------------------------------------------------------+