| | |
Save ME
Please support our Perl advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Jun 2005
Posts: 7
Reputation:
Solved Threads: 0
I have very little experience that’s why I need some help to get started I have been given a task to write a perl script in Linux and I don’t know from where to begin. Can anyone help me out with this please.
1. Move files from Windows 98 machine to this linux machine folders and sub-folders.
(I mean \\machine\c:\list\*.* to /var/www/list/) (\\machine\c:\lot_repos\*.* to /var/www/lot_repos/) & a long list is there.
2. Move the above files at a given hour of the day.
3. CHMOD this files to 644.
4. Generate a list of reports of those moved files.
As a newbie I swear that I don’t know about this from where to begin writing this script. Please some one help & save me.
1. Move files from Windows 98 machine to this linux machine folders and sub-folders.
(I mean \\machine\c:\list\*.* to /var/www/list/) (\\machine\c:\lot_repos\*.* to /var/www/lot_repos/) & a long list is there.
2. Move the above files at a given hour of the day.
3. CHMOD this files to 644.
4. Generate a list of reports of those moved files.
As a newbie I swear that I don’t know about this from where to begin writing this script. Please some one help & save me.
•
•
Join Date: Jun 2005
Posts: 7
Reputation:
Solved Threads: 0
Hello,
I have already setup samba and both windows and linux are able to communicate.
This is NO homework project or something for myself? This is real work which I am facing in the office. They want this to be done immediately and i being a new to this is unable to do. Kindly rescue me from this as the main person who was handling all this has been fired and now i am on the fire?
Kindly some one help me. Please
Thanking you in advance.
I have already setup samba and both windows and linux are able to communicate.
This is NO homework project or something for myself? This is real work which I am facing in the office. They want this to be done immediately and i being a new to this is unable to do. Kindly rescue me from this as the main person who was handling all this has been fired and now i am on the fire?
Kindly some one help me. Please
Thanking you in advance.
The reason I said this, is because it's very possible to use what's called "CRON" to have the script run at certain times and/or certain dates. On your Unix Machine, Do A man on cron: man cron
It will give you a whole lot of information about setting up any script or program to run at a certain date and time.... I can help you with all the other things.... chmoding, and moving the files (I think....I'm not sure how you reference a samba partition, is just mounted in a folder?)....
It will give you a whole lot of information about setting up any script or program to run at a certain date and time.... I can help you with all the other things.... chmoding, and moving the files (I think....I'm not sure how you reference a samba partition, is just mounted in a folder?)....
Wait, I'm still confused..... this program needs to copy files from windows to linux.... ok good. Now, we have Samba setup. Samba lets us share a directory between windows and linux.... ok great... you have 2 shares....downloads and sctdata, and these two shares.... go to /var/www/list and /var/www/lot_repos respectively. So far still so good.... so, if the windows box or windows user copies files to the downloads or sctdata share.... I'm seeing them automagically show up in /var/www/list and /var/www/lot_repos.... right? So Samba is doing all the work so far.... it's even copying the files from windows to linux right? So, if not mistaken, the perl program has no need to do anything other than chmod files, and print a report right?
•
•
Join Date: May 2005
Posts: 215
Reputation:
Solved Threads: 16
I have a similar situation. I download media files and encode movies on my windows box, then use a script to copy them over to my linux(freevo) video server. I am using bash, it seems to be the easiest. A 'for loop' would seem the easiest way to do it. This would be the general idea
or this might work
those are both over simplified, but with out more specifics. I don't really have any more to offer. Either of those scripts could be stuck in your /etc/cron.daily
Perl Syntax (Toggle Plain Text)
#!/bin/bash SAMBA=/path/to/samba/directory/to/share DEST=/path/to/linux/destination/directory for i in `ls $SAMBA` ; do cp $SAMBA/$i $DEST ; chmod 644 $DEST/$i ; done
or this might work
Perl Syntax (Toggle Plain Text)
#!/bin/bash SAMBA=/path/to/samba/directory/to/share DEST=/path/to/linux/destination/directory cp $SAMBA/* $DEST chmod -R 644 $DEST
those are both over simplified, but with out more specifics. I don't really have any more to offer. Either of those scripts could be stuck in your /etc/cron.daily
Appreciate The Input, and you are correct, that would work..... not to be too much of a stickler though, this IS a Perl forum, and not a shell scripting forum. We have one of those here: http://www.daniweb.com/techtalkforums/forum113.html, that has a bunch of shell scripting posts.
Thank you.
Thank you.
![]() |
Similar Threads
- "Save Target As.." isn't working in IE6 (Web Browsers)
- Adobe ACrobat Switches - Need to Save Automatically (Windows NT / 2000 / XP)
- AutoComplete does not promt to save passwords for IE (Web Browsers)
- Graphic Files will only save as .BMP (Web Browsers)
- IE "Save Image as;" Bitmap, wont in JPEG??? (Web Browsers)
- dell.com shopping cart save feature (Database Design)
Other Threads in the Perl Forum
- Previous Thread: noobie asking for assistance with file parsing...
- Next Thread: finding a character string
Views: 3224 | Replies: 11
| Thread Tools | Search this Thread |
Tag cloud for Perl






