Jump to content


Photo

Backup routine having issues with exec


  • Please log in to reply
6 replies to this topic

#1 Newander5

Newander5
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 13 October 2006 - 08:14 PM

Hi all, sorry if this quesiton seems stupid or confusing.

I am trying to update a backup routine that was created by my predecessor. In a nutshell we've added a new directory to the backup list.

Very simple script, basically centered around:

exec ("tar czvf /os/vm/temp/$fname.tar.gz /os/vm/msg/* /os/vm/dat/*");

Very very simple, we just tarball a couple directories, they are generally around 2-3 MB total. Works perfectly fine.

However, as I said I need to add a third directory, so I changed it to this:

exec ("tar czvf /os/vm/temp/$fname.tar.gz /os/vm/msg/* /os/vm/tab/* /os/vm/dat/*");

The problem is that now all I get in my tarball is the "dat" and "tab" directories, "msg" just gets left out altogether. If I run it from the command line it's fine. I am guessing maybe it's a timeout issue or memory issue, though the "tab" directory is only like 400k in size.

In the php.ini safe_mode = OFF, max_execution_time = 30 seconds, and memory_limit = 16M (it's an embedded system and only has 16M RAM to work with)

I can't think of anything else that would cause this, thus my posting here. I am not sure what other information to provide as there's really not a lot to the action. I am not sure if this is a PHP issue or an O/S issue.

Any help is greatly appreciated!
-Shawn

#2 effigy

effigy
  • Staff Alumni
  • Advanced Member
  • 3,600 posts
  • LocationIL

Posted 13 October 2006 - 08:36 PM

Have you checked the return value of the command?
Regexp | Unicode Article | Letter Database
/\A(e)?((1)?ff(?:(?:ig)?y)?|f(?:ig)?)\z/

#3 Newander5

Newander5
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 13 October 2006 - 08:44 PM

Yeah, I should have mentioned that, huh?

The return value is 0, and the output listing gives a list of all files compressed, which is simply absent of the "msg" directory. So not a terrible amount of help from the return value...

[EDIT] Also, if I remove the "dat" directory, I am left with a tarball containing only "tab", no "msg" still. Increasingly believing it must be a RAM thing, but the "tab" directory that is getting lobbed off is tiny...

#4 effigy

effigy
  • Staff Alumni
  • Advanced Member
  • 3,600 posts
  • LocationIL

Posted 13 October 2006 - 08:55 PM

  • Is safe mode on? Update: You mentioned it's off--oops.
  • Are there files in msg? (I have to ask...)
  • Could this be a permission issue? Although, I would think your return would be non-0 if it was...
  • How many total files are in these directories? This could be an issue where you need xargs.
  • Have you tried tee-ing the process to see what's going on?

Regexp | Unicode Article | Letter Database
/\A(e)?((1)?ff(?:(?:ig)?y)?|f(?:ig)?)\z/

#5 Newander5

Newander5
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 13 October 2006 - 09:21 PM

Yes, all 3 directories have files, and don't worry, I would ask me the same thing ;)

Permissions are identical across all 3, and I'd also expect an error code of some sort if it's a permissions thing.

"msg" has 29, "tab" has 9, and "dat" has 5. ("tab" is the newly added directory) Given that I only added 9 files I didn't think it'd trigger a need for xargs, but I will try it.

Not quite sure how I'd tee this particular process, so no, haven't done it.



#6 effigy

effigy
  • Staff Alumni
  • Advanced Member
  • 3,600 posts
  • LocationIL

Posted 13 October 2006 - 09:26 PM

What happens when you try msg all by itself?
Regexp | Unicode Article | Letter Database
/\A(e)?((1)?ff(?:(?:ig)?y)?|f(?:ig)?)\z/

#7 Newander5

Newander5
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 13 October 2006 - 09:29 PM

Works fine, packages it all with no issues. Same if I do tab by itself or dat by itself. Or if I do msg and dat. Or if I do tab and dat.

But if I do msg and tab all I get is msg, and if I do msg, tab, and dat all I get is msg and dat.

tab and msg just do not seem to want to live together.

And I just tested it with xargs: same results




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users