- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: tar directories
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-24-2002 03:07 PM
09-24-2002 03:07 PM
tar directories
I have directories t0001-t9999 and 10000-99999.
I would like to do script to tar each directory they should keep same name e.g t2222--t2222.tar and so???and transfer them trough ftp to the \\comp_name\folder_name.
Thank you in advance
Goran
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-24-2002 03:30 PM
09-24-2002 03:30 PM
Re: tar directories
Why not just use the utility designed to do just that???????
rcp
or the secured
scp
why waste your time with tar, xargs, perl, ftp, ... ???
live free or die
harry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-24-2002 04:09 PM
09-24-2002 04:09 PM
Re: tar directories
here's one method. It combines the tar and ftp in one swoop:
# get a name of the directories only
# then strip out the trailing "/"
parentDirectory=`ls -p
# Go through each directory and tar it up with the ".tar" extension
for childDirectory in ${parentDirectory}
do
tar -cvf
done
# Start the automatic ftp transfer
ftp -n $FTP_Server << endOfTransfer
user "$userName" "$password"
cd $PATH
bi
ha
prompt
mput *.tar
quit
endOfTransfer
SELECT * FROM users WHERE clue > 0
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-24-2002 04:16 PM
09-24-2002 04:16 PM
Re: tar directories
I suspect, however, that it would be fairly straightforward to script up what you need, depending on the details, of course. Some interesting combination of using 'find' to get the name of each directory, piped to 'tar -cvf', then piped to ftp... kinda fun, if you have spare time, and don't have a deadline of tomorrow.
This forum is not, alas, a script generation facility. It is possible that some such script exists, out in freeware land, but unless someone knows of one and can steer you towards it, this will not help you much. What this forum IS good for, and how it can help you, is if you have a specific question after attempting to script this up.
Try it yourself, a few diffent ways. Look at the man pages for 'tar', 'find', 'cpio', and related commands. Pay close attention to the examples, some of which show how to pipe these commands together to do the sort of thing you are needing. You will no doubt make some headway, learning a lot on the way.
When you run up against a specific issue in your efforts, post the question, get some ideas, apply to your script, repeat as necessary. We like to help, but we can't write this for you, it's got to be done on the machine where it runs, and connected to the network and PC that you will be using.
Alternatively, if you are more of a windows geek than unix geek, you might have better luck getting windows to accept RPCs from Unix, and find that 'rcp' or 'scp' make more sense, as Harry said earlier. I have no idea what that would entail.
Good Luck and best regards,
--bmr
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-24-2002 04:24 PM
09-24-2002 04:24 PM
Re: tar directories
If you are trying to expose these to a windows server, just install cifs9000, which is samba, which is smb, which fools M$ machines into thinking that the fileshares are from another m$ machine.
live free or die
harry