Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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)
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.
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.
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 ?
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.
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 .
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.