Ask a Question related to UNIX Programming, Design and Development.
-
janet #1
unix scripts
Can someone tell me where I could find some good information on
scripting or give me some guidance? I am needing to write a script to
move certain files to a different location based on when they were
created. For example a certain set of files that were created in July
could be moved to a directory called July (or some directory name that
would identify them as files created in July)created by the script.
This would be done on the last day of the month, in this case July 31.
If I know how to get the month of the files, I can create the
directory and move the files into the directory. Once I know the
script is working I would want to set it up in cron as a nightly
process.
Also to clean out old files, for example I have a directory called
July or whatever and we are in October. I don't want to keep files
more than 2 months. So I would need to check for the current month
and check to see if there is anything older than 2 months then I want
to remove contents of directory and directory.
Can anyone help or tell me where I can get help?
janet Guest
-
[ANN] Protect you Unix Shell Scripts!
Shell scripts are very powerful tools for UNIX development. Due to the fact that they are interpreted, they are easy to develop, inspect, debug... -
SHAREWARE - Unix shell scripts
Interesting comments. In general, your solutions are not portable, whereas Typhoon is portable to all modern Unices, Windows, Linux, and MacOSX. ... -
Portable Unix utility scripts
The Typhoon Toolkit (http://www.raycosoft.com/rayco/products/typhoon) contains about 90 portable utility programs for text processing, file and... -
porting perl scripts from NT to UNIX
"mani srinivas potnuru" <potnuru@students.uiuc.edu> wrote in message news:Pine.GSO.4.31.0307282029080.9550-100000@ux13.cso.uiuc.edu... You can't... -
Converting unix shell scripts to dos batch files
Anyone know of a tool or site that converts unix (bourne) shell scripts to dos batch files (for NT/2000/XP)? Thanks, --Nikolaos -
scriptOmatic #2
Re: unix scripts
janet wrote:
see the file "new" and the shell script archive at the ftp site below.>
> Can someone tell me where I could find some good information on
> scripting or give me some guidance? I am needing to write a script to
> move certain files to a different location based on when they were
> created. For example a certain set of files that were created in July
> could be moved to a directory called July (or some directory name that
> would identify them as files created in July)created by the script.
> This would be done on the last day of the month, in this case July 31.
> If I know how to get the month of the files, I can create the
> directory and move the files into the directory. Once I know the
> script is working I would want to set it up in cron as a nightly
> process.
>
> Also to clean out old files, for example I have a directory called
> July or whatever and we are in October. I don't want to keep files
> more than 2 months. So I would need to check for the current month
> and check to see if there is anything older than 2 months then I want
> to remove contents of directory and directory.
>
> Can anyone help or tell me where I can get help?
--
[url]http://ftp.opensysmon.com[/url] is a shell script archive site with an
open source system monitoring and network monitoring software package.
Many platforms are supplied already compiled.
scriptOmatic Guest
-
Chris F.A. Johnson #3
Re: unix scripts
On Fri, 01 Aug 2003 at 19:28 GMT, janet wrote:
- Google for shell script> Can someone tell me where I could find some good information on
> scripting or give me some guidance?
<http://www.google.com/search?q=shell+script>
- read the comp.unix.shell newsgroup, and look at the URLs in
some .sigs.
- read the archives of comp.unix.shell at
<http://groups.google.com/groups?group=comp.unix.shell>
- read the man pages for the commands in /bin and /usr/bin.
> I am needing to write a script to move certain files to a different
> location based on when they were created. For example a certain set
> of files that were created in July could be moved to a directory
> called July (or some directory name that would identify them as
> files created in July)created by the script. This would be done on
> the last day of the month, in this case July 31. If I know how to
> get the month of the files, I can create the directory and move the
> files into the directory. Once I know the script is working I would
> want to set it up in cron as a nightly process.
>
> Also to clean out old files, for example I have a directory called
> July or whatever and we are in October. I don't want to keep files
> more than 2 months. So I would need to check for the current month
> and check to see if there is anything older than 2 months then I
> want to remove contents of directory and directory.man mv> Can anyone help or tell me where I can get help?
man find ## /mtime
man test ## /newer
man ls ## /long
--
Chris F.A. Johnson [url]http://cfaj.freeshell.org[/url]
================================================== =================
My code (if any) in this post is copyright 2003, Chris F.A. Johnson
and may be copied under the terms of the GNU General Public License
Chris F.A. Johnson Guest



Reply With Quote

