Sponsored Content
Full Discussion: Create a cronjob
Top Forums Shell Programming and Scripting Create a cronjob Post 302253737 by heinzSchmolke on Sunday 2nd of November 2008 07:48:33 AM
Old 11-02-2008
Question Create a cronjob

Hi,

unfortunately I don't have deep programming skills yet to create a little cronjob. It would be great if someone could help me with my little programm. How it should be programmed and correctly embedded to the cron daemon.

The programm should do the following:

1. Connect to a NFS share
2. If connection fails for several times, a mail should be sent to an admin
3. If connection succeeded look for two files with the pattern 'File1_*.XXX' and 'File1_*.YYY'
4. If both files are found move files to local system and append the actual system time to the files (in front of the file suffix)
5. Look in another directory for the file having the pattern 'File2_*' und rename it to'File2_YYYYMMDD_HHMMSS' with YYYYMMDD_HHMMSS being the timestamp from step 4
6. If there is more than one file with the pattern 'File2_*' send a mail to an admin and stop the program
7. Wait for a minute and remove the two files with pattern 'File3_*'. If there are not exactly two files with that pattern, send a mail to an admin

It is necessary that the job only runs once at a time.

It would be great if someone could help me along with my little program.

Thanks in advance!
Heinz
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Cronjob

Please can someone help me. I need to set up a cron job to measure CPU usage, Disk I/O and memory usage over a period of 1 minute along with the number of users logged into the system. I also need to send it to another user besides myself every hour. Please can someone help me! Thanks. (4 Replies)
Discussion started by: gerwhelan
4 Replies

2. HP-UX

CronJob

Dear Guru, I have submitted some cronjobs that has been running for quite sometimes. However, today I counter some cronjob did not run. Can you please explain what causes this to happen. Any system setting that limit number of cronjob per minutes to be started, etc? Thanks. Kelly (1 Reply)
Discussion started by: hcng08
1 Replies

3. UNIX for Dummies Questions & Answers

cronjob

hi iam new at unix.iam running a cronjob,which i want to run on the first day of every month at 1AM.this is what i have specified: 00 01 1 * * is this corect? (1 Reply)
Discussion started by: wiz83
1 Replies

4. Solaris

at vs cronjob

HI, What is the differnece between at / con job? thanks in advance. (1 Reply)
Discussion started by: mokkan
1 Replies

5. Shell Programming and Scripting

Cronjob

Hi, I'm totally new to shell scripting. I need help in my crontab script. I'm trying to read some values from user (username, log file directory, server) and then use those value to create a crontab for log rotation after some interval of time. creating crontabs manually isn't big deal.... (11 Replies)
Discussion started by: MisterKhan
11 Replies

6. UNIX for Dummies Questions & Answers

how to cancel a cronjob if the cronjob still running

hi everyone I'm newbie in this forum hope I can get some help here :) I have a command in crontab that executed every 1 minute sometime this command need more than 1 minute to finish the problem is, the crontab execute this command although it's not finish processing yet and causing the system... (7 Replies)
Discussion started by: 2j4h
7 Replies

7. UNIX for Dummies Questions & Answers

Cronjob help

Hi I am very new to linux. I want to run a cronjob every 15 minutes that checks a directory for files. If the directory contains more than ten files I want it to send an email to me. All I have is this... */15 * * * * ls -l | wc -l | | mail -s "This is just a test" I would... (2 Replies)
Discussion started by: LinuxNewb
2 Replies

8. UNIX for Dummies Questions & Answers

How to create a cronjob for the 3rd business day of every month?

Hello, Can you please help me out in creating a cronjob that runs every 3rd business day of the month. Thanks (2 Replies)
Discussion started by: AReddy
2 Replies

9. Shell Programming and Scripting

awk to create variables to pass into a bash loop to create a download link

I have created one file that contains all the necessary info in it to create a download link. In each of the lines /results/analysis/output/Home/Auto_user_S5-00580-6-Medexome_67_032/plugin_out/FileExporter_out.67... (8 Replies)
Discussion started by: cmccabe
8 Replies

10. UNIX for Beginners Questions & Answers

Cronjob

How to set cronjob for 48 hours. I can set for 2 days as shown below. * * */2 * * It is creating confusion for 30 days & 31 days per month. (3 Replies)
Discussion started by: Nishit
3 Replies
SYSTRAQ(8)							  [FIXME: manual]							SYSTRAQ(8)

NAME
systraq - monitors your system and warns you when files change SYNOPSIS
systraq DESCRIPTION
systraq is part of the systraq package, a set of scripts that monitors your system for file changes. It is meant to be run by a cronjob, not directly. systraq runs various system commands, to inspect the state of the system: what is it doing now?, what has it been doing recently?, are we running to hardware limitations?. Furthermore, it runs commands to inspect some files in users' homedirectories, as well as some system files, for frequently seen flaws. All these commands are maintained in little scripts in /etc/systraq/systraq.d. The first two characters of the script's name are used for the execution-order. The names of executable files in systraq.d/ (or symlinks to such files) must consist entirely of upper and lower case letters, digits, underscores, and hyphens. Files which not adhere will be silently ignored. The systraq script supplies some environment variables to the scripts in systraq.d/, these might be helpful when adding your own scripts. Refer to the (very small) systraq code itself for the details. We'll elaborate on some of the shipped systraq.d/ scripts. AA-shellrc checks for unsafe umask setting in shell startup scripts, or unsafe PATH in these scripts. AA-debsums runs debsums, to check md5sums as stated in packaging files with the sums of the actual files running the system. (NB: debsums has support for md5 checksums only, most Debian packages ship md5 checksums only. Therefore, we can't use sha256sum. See also the discussion on proposed release goal: DEBIAN/md5sums for all packages[1] at the Debian release mailinglist in August 2007 as well as Debian Bug #268658[2] for some considerations on this.) AA-localdigest runs sha256sum (or the command set in the ST_SUM environment variable) to check message digests as locally maintained in a file named in the ST_LDIGESTS environment variable. Typically, this is set to /var/lib/systraq/systraq.sums. If this environment variable is unset, this check is silenty skipped. Of course, you can add your own scripts. If you name them AA-local, they'll never get overwritten by any version of this software. If you don't like one of these scripts, you can disable it by removing the symlink, and creating a new symlink with the same name pointing to /bin/true. SEE ALSO
The systraq Manual, installed in /usr/share/doc/systraq. VERSION
$Id: systraq.dbx 374 2008-12-14 08:47:32Z joostvb $ AUTHORS
Joost van Baal <joostvb-systraq-20041015@mdcc.cx> Author. Laurent Fousse <laurent@komite.net> Author. COPYRIGHT
Copyright (C) 2001-2008 Joost van Baal Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License, Version 2 or any later version published by the Free Software Foundation. This document is based upon a manual page written by Laurent Fousse for the Debian project. NOTES
1. proposed release goal: DEBIAN/md5sums for all packages http://lists.debian.org/debian-release/2007/08/threads.html#00086 2. Debian Bug #268658 http://bugs.debian.org/268658 [FIXME: source] 17 december 2008 SYSTRAQ(8)
All times are GMT -4. The time now is 08:37 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy