LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-18-2009, 10:15 AM   #16
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976

Quote:
Originally Posted by rjo98 View Post
The joe folder actually is a watch folder, so once the file gets there it gets imported into another system them deleted. So truly all I need to do is 1) get the file to the joe folder on the other server then 2) delete it from the send2joe folder so it doesn't keep getting put in the joe folder and reimported over and over into the other system.
Rjo, your best bet is to produce and analyze some logs at this point. And since we are too much curious, post them here.
 
Old 09-18-2009, 11:21 AM   #17
rjo98
Senior Member
 
Registered: Jun 2009
Location: US
Distribution: RHEL, CentOS
Posts: 1,668

Original Poster
Rep: Reputation: 46
ok, so I just type an echo before the mv command in the .sh, then edit my crontab and put something like > $HOME/cron.log 2>&1 after the line calling the script?

could i make the log file /var/log/crontab.log or something instead?
 
Old 09-18-2009, 11:23 AM   #18
forrestt
Senior Member
 
Registered: Mar 2004
Location: Cary, NC, USA
Distribution: Fedora, Kubuntu, RedHat, CentOS, SuSe
Posts: 1,288

Rep: Reputation: 99
You can make it anything you like as long as you can write to it.

HTH

Forrest
 
Old 09-18-2009, 11:26 AM   #19
rjo98
Senior Member
 
Registered: Jun 2009
Location: US
Distribution: RHEL, CentOS
Posts: 1,668

Original Poster
Rep: Reputation: 46
thanks. first i'm going to have the guy drop a file in there just to see if its something stupid like its read only or something. if that's not it, i'm going to do all this. I will let you guys know!
 
Old 09-18-2009, 11:42 AM   #20
forrestt
Senior Member
 
Registered: Mar 2004
Location: Cary, NC, USA
Distribution: Fedora, Kubuntu, RedHat, CentOS, SuSe
Posts: 1,288

Rep: Reputation: 99
The file being read only shouldn't be a problem as it is the directory permissions that allow you to add/remove files from it.

Forrest
 
Old 09-18-2009, 11:45 AM   #21
rjo98
Senior Member
 
Registered: Jun 2009
Location: US
Distribution: RHEL, CentOS
Posts: 1,668

Original Poster
Rep: Reputation: 46
Oh ok. I know I've had problems on Windows servers with this type of thing because something was read only before, guess old habits are hard to break haha.
 
Old 09-18-2009, 12:09 PM   #22
rjo98
Senior Member
 
Registered: Jun 2009
Location: US
Distribution: RHEL, CentOS
Posts: 1,668

Original Poster
Rep: Reputation: 46
Just as we suspected

No such file or directory

So i wonder what's deleting the files out of there normally. I'll let you guys know what I end up finding. Always fun supporting servers that other people set up haha.
 
Old 09-18-2009, 12:48 PM   #23
MS3FGX
LQ Guru
 
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356
Well I am a little confused here...if you know the "sent2joe" directory doesn't exist, then why are you trying to move files to it? Obviously you are going to get an error. Why not just create the directory so the files are moved there?

But, like forrestt said, it really sounds like rsync is what you want here. rsync will keep track of any changes on the local side, and update the remote server accordingly. As long as you don't explicitly tell it to, rsync won't delete files on the remote side that have been removed from the local either. So files could safely be removed from "send2joe" at any time (or never at all, whatever works for your situation).
 
Old 09-18-2009, 12:51 PM   #24
rjo98
Senior Member
 
Registered: Jun 2009
Location: US
Distribution: RHEL, CentOS
Posts: 1,668

Original Poster
Rep: Reputation: 46
I'm confused to, that's why I posted, haha. this whole process was setup by someone else, not myself.

What I think I'm going to do for the interm is just recreate the folder. Then I just have to figure out how I can automatically clean up that soon-to-be-no-longer-missing folder of all files that are older than a week (so that doesn't get overly full and fill up my drive eventually).

that will at least give me time to look into rsync.
 
Old 09-18-2009, 12:57 PM   #25
MS3FGX
LQ Guru
 
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356
Is there a reason they are even being kept? Do you need to retain them as backups for a certain amount of time?

Also (I understand this is not your setup and not your problem directly), that is an exceptionally poor "script". It isn't even verifying if the scp process completed before it moves (deletes) the files. So if that was run while the remote machine was down or you momentarily lost Internet connectivity, the files would simply be deleted and you would never even know they didn't get there.

Whatever you replace this with, you definitely want to make sure it is more robust than what they have now.
 
Old 09-18-2009, 01:04 PM   #26
rjo98
Senior Member
 
Registered: Jun 2009
Location: US
Distribution: RHEL, CentOS
Posts: 1,668

Original Poster
Rep: Reputation: 46
I think we just want to keep them temporarily as a backup, probably overparanoid more than anything.

is there a special way to have scp verify that the remote file was written successfully or anything?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Need help with script to organise files into folders as part of DVD backup script jasybee2000 Linux - Newbie 5 06-15-2009 08:29 PM
How to get full path to script file inside script itself? And in case of sym links? maggus Linux - Newbie 3 05-28-2009 09:40 AM
I want to run script on the server from client machine in windows in a perl script vpradeep Linux - Newbie 2 09-01-2008 04:29 AM
ssh - using variables in call to start remote script from local script babag Linux - Networking 2 06-03-2008 05:50 PM
send automatic input to a script called by another script in bash programming jorgecab Programming 2 04-01-2004 01:20 AM


All times are GMT -5. The time now is 05:40 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration