nixCraft Linux Forum

nixCraft

Linux / UNIX Tech Support Forum

Script To Copy Files From Windows XP To Linux Server

This is a discussion on Script To Copy Files From Windows XP To Linux Server within the Shell scripting forums, part of the Development/Scripting category; Hi All, I am a newbbie here, first of all, kudos toall theadministrator of this forum site. They have don ...


Go Back   nixCraft Linux Forum > Development/Scripting > Shell scripting

Linux answers from nixCraft.


Shell scripting You can discuss the shell scripting, request shell scripts and scripting techniques

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 16-09-2009, 11:40 AM
Junior Member
User
 
Join Date: Sep 2009
OS: redhat
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
haykins is on a distinguished road
Default Script To Copy Files From Windows XP To Linux Server

Hi All,
I am a newbbie here, first of all, kudos toall theadministrator of this forum site. They have don very great. And also all the users and the urus ae are fanstastic. I am very happy to be a member here. I have this problem in my compnay which I was give 2days to solve unfailingly. here it goes.
On Our Window XP based playout server are some AVmedia files for playout,exported from the Production server which is rhel4 based via a network drive. Now I am being tasked to write a shell script to Automate copying of unused Avmedia files from the window xp based playout server to a RHEL4 DV station backup system at a particular time and also return files at another time t. The unused AV media files to be copied by shell scripts will be in one folder and it will return to different folder on the same window xp based playout server. Please kindly help me to write the script as I have ever written any automated script before. Thanks all
Reply With Quote
  #2 (permalink)  
Old 16-09-2009, 07:33 PM
jaysunn's Avatar
Powered By Linux
User
 
Join Date: Apr 2009
Location: 41.332032,-73.089775
OS: RHEL - OSX
Scripting language: BASH - Learning Ruby
Posts: 602
Thanks: 61
Thanked 80 Times in 72 Posts
Rep Power: 10
jaysunn is a splendid one to behold jaysunn is a splendid one to behold jaysunn is a splendid one to behold jaysunn is a splendid one to behold jaysunn is a splendid one to behold jaysunn is a splendid one to behold jaysunn is a splendid one to behold jaysunn is a splendid one to behold
Default

So let me get this straight, the files are on a drive on the RHEL AV production server. Is this share a samba share that the windows machine mounts?

And you need them copied from the samba share to another RHEL DV machine. You can most likely achieve this with ssh keys and rsync. If I am understanding correctly the Windows server is just mounting the share from the RHEL AV server. So you may be able to just eliminate that server from the equation.


Jaysunn
__________________
Have a look at what I have been working on
http://www.shellasaurus.com
Reply With Quote
  #3 (permalink)  
Old 17-09-2009, 12:33 AM
Junior Member
User
 
Join Date: Sep 2009
OS: redhat
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
haykins is on a distinguished road
Default a script to compy from windoxp to linux and vice versa

ok. There is a window xp base production server contained video files for play out. There is another server which is a linux base server placed in the network of the window xp based production server. I normally copy the files in the windo xp production server to the linux server for storage/backup and also compy it back to the window xp server at a time t. Now I want a shell script to automate this process. please help
Reply With Quote
  #4 (permalink)  
Old 17-09-2009, 12:46 AM
jaysunn's Avatar
Powered By Linux
User
 
Join Date: Apr 2009
Location: 41.332032,-73.089775
OS: RHEL - OSX
Scripting language: BASH - Learning Ruby
Posts: 602
Thanks: 61
Thanked 80 Times in 72 Posts
Rep Power: 10
jaysunn is a splendid one to behold jaysunn is a splendid one to behold jaysunn is a splendid one to behold jaysunn is a splendid one to behold jaysunn is a splendid one to behold jaysunn is a splendid one to behold jaysunn is a splendid one to behold jaysunn is a splendid one to behold
Default

Hmm,

You may want to look into samba for the linux server. Than you can mount the linux partition on windows. Then you can setup a Windows Scheduled task that can move the files to the samba partition via a Windows batch file.


This is just a suggestion. Please have a look at these links. Also you can look into cygwin which allows you to execute unix commands on Windows. You can then mount the samba partition on the Windows box and run a rsync at any time interval.

A bit old. But a goodie:

Configuring a Samba Server

To install Cygwin:

Cygwin Information and Installation


If anyone else has a shell script. Feel Free to paste it.

HTH,
jaysunn
__________________
Have a look at what I have been working on
http://www.shellasaurus.com
Reply With Quote
  #5 (permalink)  
Old 17-09-2009, 01:56 AM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
OS: RHEL
Scripting language: Bash and Python
Posts: 2,710
Thanks: 11
Thanked 245 Times in 184 Posts
Rep Power: 10
nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute
Default

Quote:
window xp base production server
I don't believe you! There is no such thing called xp server. Go to Windows XP > Right click and share your directory. Go to Linux and type the command:
Code:
mkdir -p /mnt/windowsxp
mount -t smbfs -o username=xpusername,password=XpPassword //windowsxp/sharename  /mnt/windowsxp
cd /mnt/windowsxp
cp *.avi /home/you/backup/
cd -
umount /mnt/windowsxp
__________________
Vivek Gite
Linux Evangelist
Be proud RHEL user, and let the world know about your enterprise choices! Join RedHat user group.
Always use CODE tags for posting system output and commands!
Do you run a Linux? Let's face it, you need help
Reply With Quote
  #6 (permalink)  
Old 17-09-2009, 01:47 PM
Junior Member
User
 
Join Date: Sep 2009
OS: redhat
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
haykins is on a distinguished road
Default read carefully.....lol

HI,
tHANKS FOR THE SUPPORT. iTS LIKE YOU DO NOT UNDERSTAND ME. THE FILES ARE ON A pLAYBOX PLAYOUT SERVER AND ITS WINDOW XP OPERATING SYSTEM ON IT. SO THE OTHER SYSTEM FOR STORAGE IS A DV STATION LINUX OPERATING SYSTEM RUNNING ON IT. SO I NEED A A SCRIPT TO AUTOMATE THE PROCESS OF COPING FILES FROM THE WINDOW XP PLAYOUT SERVER AT A PARTICULAR TIME T AND ALSO RETURN FILES FROM THE LINUX BASE DV STATION TO THE WINDOWS XP PLAYOUT SERVER AT A PARTICULAR TOME T. a SHELL SCRIPT IS NEED TO AUTOMATE THIS PROCESS OR ANY OTHER THING YOU KNOW IT COULD AUTOMATE THIS PROCESS. THANKS A LOT
Reply With Quote
  #7 (permalink)  
Old 18-09-2009, 12:12 PM
kumarat9pm's Avatar
Senior Member
User
 
Join Date: Jun 2007
Location: Pune,MH,India
OS: RHEL,UBUNTU..
Posts: 447
Thanks: 20
Thanked 20 Times in 18 Posts
Rep Power: 5
kumarat9pm has a spectacular aura about kumarat9pm has a spectacular aura about kumarat9pm has a spectacular aura about
Send a message via Yahoo to kumarat9pm Send a message via Skype™ to kumarat9pm
Default hay buddy what nixcraft said is right

here is the modified script for you

#!/bin/bash
mkdir -p /mnt/windowsxp

mount -t smbfs -o username=xpusername,password=XpPassword //windowsxp/sharename /mnt/windowsxp
cd /mnt/windowsxp
cp *.avi /home/you/backup/

#the below command will stop/sleep for 300 seconds, so you can specify your time between your data coping form xp to linux and linux to xp.

sleep 300
cd /ur/files/location/on/linux
cp *.avi /mnt/windowsxp
cd -
umount /mnt/windowsxp
#########
save this file and schedule a cronjob in linux, so that the script will execute at your desired time.
please current me if i am wrong
Reply With Quote
Reply

Tags
backup windows files to linux , backup xp files to rhel , linux and windows file sharing , windows rhel backup


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
Linux Shell Script to upload log files to Windows XP based FTP Server stefanuscyberia Shell scripting 6 18-11-2009 01:29 PM
configuring Linux sendmail server and Windows Exchange server 2k3 so they share mails amit.rhce Mail Servers 2 10-09-2009 01:43 PM
configuring Linux sendmail server and Windows Exchange server 2k3 so they share mails amit.rhce Windows Xp/2000/2003 server administration 0 13-06-2009 06:43 PM
How to copy and paste files in FreeBSD enochalbert All about FreeBSD/OpenBSD/NetBSD 1 01-09-2008 07:12 PM
How to copy . files from current directory ricc Linux software 1 10-06-2006 09:23 PM


All times are GMT +5.5. The time now is 04:37 AM.


Powered by vBulletin® Version 3.8.5 - Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2
©2005-2010 nixCraft. All rights reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38