LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 06-12-2013, 07:58 AM   #1
eeps24
LQ Newbie
 
Registered: Jun 2013
Posts: 7

Rep: Reputation: Disabled
Unhappy please help - CRON issues


We have 2 servers (production and test). Our current setup is we have cron scripts that run daily, they move files from a folder then archive them to another location. The cron scripts were accidentally deleted from production. Now this folder is increasing in size each day which we do not want it to do.

On the plus side, our scripts on test are working just fine. We thought that we could just copy the scripts from test (which are working) over to production. Negative, the scripts are not running.

Is there an issue with copying over cron scripts to another location? Is there rights that get lost in the process or something that we are missing?

please help

(I know very little linux, we hired a consultant long ago to create these scripts for us and who is no longer around)
 
Old 06-12-2013, 08:48 AM   #2
megerdin
Member
 
Registered: Jul 2007
Location: London
Distribution: FC11,FC10,FC7,FC4,Centos 5.1,Ubuntu,Mandrake Linux,puppy.LinuxMint.Opensuse
Posts: 181

Rep: Reputation: 31
Quote:
Originally Posted by eeps24 View Post
We have 2 servers (production and test). Our current setup is we have cron scripts that run daily, they move files from a folder then archive them to another location. The cron scripts were accidentally deleted from production. Now this folder is increasing in size each day which we do not want it to do.

On the plus side, our scripts on test are working just fine. We thought that we could just copy the scripts from test (which are working) over to production. Negative, the scripts are not running.

Is there an issue with copying over cron scripts to another location? Is there rights that get lost in the process or something that we are missing?

please help

(I know very little linux, we hired a consultant long ago to create these scripts for us and who is no longer around)
surely this will work, as long as you put your new script in same place where old script was with same name and with executable permission.

1. Rename script
2. copy to current directory

3. Give it correct permission

Code:
chmod +x yourscript

Hope this will help u.
 
Old 06-12-2013, 09:07 AM   #3
thedaver
Member
 
Registered: Jan 2010
Posts: 65

Rep: Reputation: 21
If the cron entries remain in /etc/crontab (or ~/.crontab?) then the commands would continue to be triggered on Production, but would fail since the scripts are missing on Prod (as you say). You should see a record of this in /var/log/syslog

The scripts for test might have different references to folders or credentials that would be appropriate for Prod. If you've copied the test scripts to Prod box and they are not working, then there may be adjustments needed to transition to Prod settings.
 
Old 06-12-2013, 09:14 AM   #4
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,313

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
are they running but failing or are they not running at all ?

the likely culprit is the test commands are not exactly the same as the prod commands (e.g.- /var/test/execute vs. /var/prod/execute). youll have to make modifications appropriate for each environment.

are the schedules listed when you run crontab -l ?

Last edited by schneidz; 06-12-2013 at 09:20 AM.
 
Old 06-12-2013, 09:39 AM   #5
eeps24
LQ Newbie
 
Registered: Jun 2013
Posts: 7

Original Poster
Rep: Reputation: Disabled
they are running but failing, I have to go back and see if they are in crontab -l ?

We emailed the consultant and he responded saying "the issue is in the user configuration" We tried to email him back but he is not responding.... my question is, what is the user configuration? In the folder where the scripts are located, there is a file called "fuser" its an executable, not sure what it does but would that be the file I need to look into and make changes? I never clicked on it before.
 
Old 06-12-2013, 10:32 AM   #6
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,313

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
if they are running then the system is reading them from the crontab list.

this seems to be a site specific customization so nothing that anyone can guess at (especially with no source code or error codes).

i would browse thru your scripts and edit anything that is specific to your test server so that it references the appropriate thing for your production server.

since all they are doing is backing up files, i would just re-write the scripts. seems like you would just need to run tar -cvjf /path/to/backup/location /path/to/prod/dir .

Last edited by schneidz; 06-12-2013 at 10:38 AM.
 
Old 06-12-2013, 11:46 PM   #7
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
As above, we'd need to see the crontab entries and the content of the scripts to even begin to help.
Also, any msgs from the current setup.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Cron job issues Alan87i Ubuntu 21 07-14-2011 02:49 AM
issues in setting up cron. saini_mw Linux - Newbie 6 02-01-2011 07:17 AM
Issues with cron synapse Slackware 4 07-21-2006 01:00 AM
cron issues kaplan71 Fedora 1 10-26-2005 07:40 AM
vixie-cron issues Bigun Linux - Software 1 12-17-2004 09:08 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 11:22 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration