Shell Script Help

Bar discussions . Talk about everything not only php !. Guests are welcome here , forum registration is not required.

Moderators: macek, egami, gesf

Pritesh23
New php-forum User
New php-forum User
Posts: 25
Joined: Wed Jul 17, 2013 12:42 pm

Shell Script Help

Postby Pritesh23 » Sat Oct 26, 2013 2:09 pm

Hello,

I have one tar.Z file. I have to run shell script daily as it is required to update the database. :help:

Code: Select all

    customer_yyyymmdd_hhmi.tar.Z
   
    sales_ yyyymmdd_hhmi.csv (5 MB - 20 MB)
    purchase_ yyyymmdd_hhmi.xml (650 MB - 950 MB)


I have made small part of XML file. There are 4 parts. There is PHP Script which is working but i need to change each time file like PART1.xml, PART2.xml etc.

Things to do:

1) Extract tar.Z file and Read CSV and XML file.
2) Read whole XML file automatically.


I hope i am clear. :) Thanks in advanced for your time and input. :help:

Pritesh23
New php-forum User
New php-forum User
Posts: 25
Joined: Wed Jul 17, 2013 12:42 pm

Re: Shell Script Help

Postby Pritesh23 » Mon Oct 28, 2013 5:37 am

I need something like this. :? This is just REFERENCE. It is not working. :(

Code: Select all

#!/bin/sh
DB_USER="****"
DB_PASS="****"
DB_NAME="****"
echo
date
cd customer
for i in *-*.php
do
  echo $i
  php $i $1
  echo
  date


:help:

THANKS IN ADV.


Return to “Free time”

Who is online

Users browsing this forum: No registered users and 0 guests