At command not running out of hours


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers At command not running out of hours
# 1  
Old 07-03-2015
At command not running out of hours

Hi All,

new to the forum and new to Unix but I have an issue which is annoying on a new level. I have included a short and full version for anyone needing more information.

Short Version

I am running a set of scripts that work and run fine. one of the scripts arranges the first script to run the day after at 19:00. The scripts run fine and I have even at 9am in the morning, set the first script to run at 3PM and it works yet 7PM comes around and the script doesn't run.

Full Version

I'm trying to schedule scripts to run the following tasks at 7PM in the evening.

Snapshot all servers
Export all snapshots to storage
Delete all snapshots
Re-Schedule the job for the following day.

I just want to start by saying this is the first time I've done anything like this and I understand that what I've created is incredibly basic and could be done 1000% times easier but for that I need more knowledge and I really need to get this working before I can develop the process a bit more.

so here is how I'm doing it. I have 3 scripts which are as followed

  • Backups: This will run Schedule_Job_Script then Run_Backup_Script
  • Schedule_Job_Script: This will run at 19:00 tomorrow <<< "Backups"
  • Run_Backups_Scripts: This will run the backup jobs

these all work fine and do what I need them to do. I have even at 9AM set the backups script to run at 3PM in the afternoon and it works fine and the new job is created fine. It seems that the script will not run at 19:00 and I have no idea why.

As I said before this is the first time I've used Unix and have no knowledge of troubleshooting.

If someone could suggest a possible reason to this happening or point me in the right direction of finding out why its happing I would be hugely grateful.

Thanks
Del
# 2  
Old 07-03-2015
Since you dont show us the code, it will be difficult to help you... And we dont know on what system you are running ( OS - version ) and shell you are using...
# 3  
Old 07-03-2015
this is first script that's is ran

Code:
 #Schedule Next Backup Job - re-run this script
sh < /Scripts/Schedule_Job.txt
 #Run Script to Perform Backups
sh < /Scripts/Run_Backup.txt

which runs fine through the day.

it's running through the command line in Citrix XenServer 6.2.

I've just had a thought though. I'm setting this to run through XenCenter which is then left open all day. I wonder if I set it off from the host itself it might work.

as I said the scripts run fine while I'm sat here just not when I have gone home.

Last edited by rbatte1; 07-03-2015 at 09:44 AM..
# 4  
Old 07-03-2015
Then you definitely should not go home any more!

Why don't you leave the scheduling to cron and have it run just the backup script every day at 19:00h?
Code:
crontab -e                                # edit your crontab file
0 19 * * * /Scripts/Run_Backup.txt        # add this line to the file

# 5  
Old 07-03-2015
Quote:
Originally Posted by RudiC
Then you definitely should not go home any more!

Why don't you leave the scheduling to cron and have it run just the backup script every day at 19:00h?
Code:
crontab -e                                # edit your crontab file
0 19 * * * /Scripts/Run_Backup.txt       # add this line to the file

thanks this helped! the posts I seen about cron said the command was "cron -e" which didn't work. i'll see if that makes it work
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

How to check the processes running longer than 2 hours.?

HI can someone help me to check the process running more than 2 hours. I have the below command which shows the time and process id, however, I only need the processes running more than 2 hours. (8 Replies)
Discussion started by: Vinod
8 Replies

2. UNIX for Beginners Questions & Answers

How to display processes which have been running for more than a X hours?

Hi, Is it possible to display processes which have been running for more than a 5hrs using a variation of the ps -ef command? Regards, Manny (5 Replies)
Discussion started by: mantas44
5 Replies

3. Shell Programming and Scripting

Run a command once in three hours

Hi All, I have a bash script which is scheduled to run for every 20 minutes. Inside the bash script, one command which I am using need to be triggered only once in two or three hours.Is there anyway to achieve this. For example, if then echo "hi" else echo "Hello" UNIX Command---once... (5 Replies)
Discussion started by: ginrkf
5 Replies

4. Shell Programming and Scripting

Print only processes running for more than 24 hours

How can I print ONLY processes running for more than 24 hours. Using ps command or any other method I use this to get a whole list. ps -eo pid,pcpu,pmem,user,args,etime,cmd --sort=start_time We can also sort the outout of the above command to list processes older than 24 hours using... (9 Replies)
Discussion started by: anil510
9 Replies

5. Shell Programming and Scripting

List of Running Jobs In Last 4 Hours

Hi Experts, Please help me in this. I am trying this code on AIX 5.3. I need list of jobs that executed in last 4 hours. I have a schedule on this script - cron executes it and sends mail to me for every 2 hours. I have a Job time and have around 100 jobs those execute daily. What all i need... (2 Replies)
Discussion started by: rajubollas
2 Replies

6. Shell Programming and Scripting

Capture the running process for 2 hours

Hi, How can i capture the running process for 2 hours. Thanks in advance.:b: (1 Reply)
Discussion started by: sarathkumar
1 Replies

7. Shell Programming and Scripting

Capture running process or 2 hours with an interval of 10 sec

Hi, Can any one help me on this. How to capture the running process for two hours with an interval of 10 sec. Thanks in andvance (1 Reply)
Discussion started by: sarathkumar
1 Replies

8. UNIX for Dummies Questions & Answers

Capture running process for 2 hours with an interval of 10 sec

Hi, Can any one help me on this. How to capture the running process for two hours with an interval of 10 sec. Thanks in andvance Double post, continued here, thread closed (0 Replies)
Discussion started by: sarathkumar
0 Replies

9. Shell Programming and Scripting

Command to clear logs for every 6 hours in solaris

Hi Folks, I need to remove log files for six hours on Solaris. before i used to do for every 24 hours below is the code for 1 day older log files, now i tried using -mmin +360 but it says command not found. Can someone please help me out!!! part of the code: LOG_FILE=`find /home/Logdir... (1 Reply)
Discussion started by: Sendhil.Kumaran
1 Replies

10. UNIX for Dummies Questions & Answers

AT command to batch execute every x hours

I want to schedule a batch job (SQL)to run every 6 hours in Unix and the AT command syntax does not seem to cover this. I have created a file ncd_rpt in the directory report and have given the command in this file. at -f /report/ncd_rpt 1:00 am tomorrow I schedule this by running sh... (1 Reply)
Discussion started by: naveen79
1 Replies
Login or Register to Ask a Question

Featured Tech Videos