Go Back   FlashFXP Forums > > > >

! Requests Need a script or some sort of cool .bat file ? Ask here!

Reply
 
Thread Tools Rate Thread Display Modes
Old 05-31-2004, 05:14 PM   #1
PopWeasel
Senior Member
ioFTPD Scripter
 
Join Date: Feb 2004
Posts: 181
Default [Filled] Tar/Rar packing script

Ok I'm pretty sure this doesn't exist already cos I looked and didnt find nthn. I tried to do this myself already but I dont know the proper cookie variable to pass "all files in current dir" to the script..

What I'd like to do is have a cmd, 'SITE TAR' for instance, which will tar all files in current dir. This will allow certain users with proper perm flag to do this without giving them full root axx to the dedi. The farthest I got was that it works good, except that it tars all files in the ioFTPD/system dir.
Thx.
PopWeasel is offline   Reply With Quote
Old 06-01-2004, 12:30 AM   #2
PopWeasel
Senior Member
ioFTPD Scripter
 
Join Date: Feb 2004
Posts: 181
Default

By the way, rar format is also ok. I said tar only because it's a free util. And perhaps easier to do this with?
PopWeasel is offline   Reply With Quote
Old 06-01-2004, 01:37 AM   #3
neoxed
Too much time...
FlashFXP Beta Tester
ioFTPD Scripter
 
Join Date: May 2003
Posts: 1,326
Default

You could easily accomplish this using a batch file. For example:

dir /a /b > files.lst
rar a myarchive.rar @files.lst
del /f file.list

Perhaps this thread may be of interest to you as well. http://www.ioftpd.com/board/showthre...&threadid=1670
neoxed is offline   Reply With Quote
Old 06-02-2004, 03:35 PM   #4
PopWeasel
Senior Member
ioFTPD Scripter
 
Join Date: Feb 2004
Posts: 181
Default

I tried all the methods listed and the results are either printing the rar help file to the status window (meaning the proper parameters were not passed to rar.exe) or a *.rar file being created in ioFTPD/system dir with the contents of that dir in it. I still cannot get the parameter for "all files in current dir" passed to rar.exe correctly. Even rar "this highlighted dir" would work but I can't get that passed to rar.exe as the proper parameter either. =\
PopWeasel is offline   Reply With Quote
Old 06-05-2004, 04:36 PM   #5
PopWeasel
Senior Member
ioFTPD Scripter
 
Join Date: Feb 2004
Posts: 181
Default

Ok, this is what I have at this point. Maybe someone can see what I'm doing wrong.

[FTP_Custom_Commands]
#Rar
rar = EXEC ..\scripts\Rar\rar.bat

rar.bat:
dir /a /b > files.lst
..\scripts\Rar\Rar.exe a myarchive.rar @files.lst
del /f files.lst

[R] site rar My.All.Time.Fav-ReLZ
[R] 200-
[R] 200-C:\ioFTPD\system>dir /a /b 1>files.lst
[R] 200-
[R] 200-C:\ioFTPD\system>..\scripts\Rar\Rar.exe a myarchive.rar @files.lst
[R] 200-
[R] 200-RAR 3.30 Copyright (c) 1993-2004 Eugene Roshal 22 Jan 2004
[R] 200-Registered to - User of World -
[R] 200-
[R] 200-Creating archive myarchive.rar
[R] 200-
[R] 200-Adding .ioFTPD  0% OK
[R] 200-Adding files.lst  0% OK
[R] 200-Adding ioFTPD.exe  1% 2% 4% 5% 6% 7% 9% 10% 11% 13% OK
[R] 200-Adding ioFTPD.ini  13% OK
[R] 200-Adding php4ts.dll  15% 16% 17% 19% 20% 21% 23% 24% 25% 27% 28% 29% 31% 32% 33% 35% 36% 37% 39% 40% 41% 43% 44% 45% 47% 48% 49% 51% 52% 53% 55% 56% 57% 59% 60% 61% 63% 64% 65% 67% OK
[R] 200-Adding tcl84t.dll  69% 70% 71% 73% 74% 75% 77% 78% 79% 81% 82% 83% 85% 86% 87% 89% 90% 91% 93% 94% 95% 97% 98% 99%100% OK
[R] 200-Done
[R] 200-
[R] 200-C:\ioFTPD\system>del /f files.lst
[R] 200 Command successful.

I now have a file called myarchive.rar in my C:\ioFTPD\system dir comprised of the contents of that dir.
PopWeasel is offline   Reply With Quote
Old 06-06-2004, 04:25 PM   #6
neoxed
Too much time...
FlashFXP Beta Tester
ioFTPD Scripter
 
Join Date: May 2003
Posts: 1,326
Default

Well you have to CD to the current directory, I was just giving you an idea in my previous post. Try this batch file, it works for me.
Quote:
@echo off
cd /d %SYSTEMPATH%
echo RARing Current Directory...
echo !detach 0
dir /a /b > .ioFTPD.rarlist
"C:\Program Files\WinRAR\rar.exe" a -m0 -x.ioFTPD.* !Archived.rar @.ioFTPD.rarlist
del /f .ioFTPD.rarlist
exit 0
Notes:
- Make sure you have SYSTEMPATH=%[$path] in your /etc/ioftpd.env.
- Change the path to your rar.exe if it's located elsewhere.
- I used the -m0 switch to avoid compressing the directory, it's much quicker this way.
neoxed is offline   Reply With Quote
Old 06-06-2004, 10:02 PM   #7
PopWeasel
Senior Member
ioFTPD Scripter
 
Join Date: Feb 2004
Posts: 181
Default

This is great but something weird now. I have two ioFTPD test setups and it works flawless on one but still rar's the contents of ioFTPD/system/ on the other one. The only difference between them is the one it doesn't work on has a multi-volume vfs (meaning that site has root dir on c: and all parent dirs on another hdd) and the one it works on the vfs is all on the c: drive. Both have the SYSTEMPATH=%[$path] variable in ioftpd.env. Is there anything about this script that would make it not work on multi-volume vfs ftp's? If so I'll understand, if not I wonder why it doesn't work on the other one..
PopWeasel is offline   Reply With Quote
Old 06-06-2004, 10:18 PM   #8
neoxed
Too much time...
FlashFXP Beta Tester
ioFTPD Scripter
 
Join Date: May 2003
Posts: 1,326
Default

Whoops, I forgot the /D switch on the CD command to change to directories that are on different drivers. Otherwise it would only work on the drive that ioFTPD.exe is on.

Updated the above thread.
neoxed is offline   Reply With Quote
Old 06-06-2004, 10:58 PM   #9
PopWeasel
Senior Member
ioFTPD Scripter
 
Join Date: Feb 2004
Posts: 181
Default

I feel like a kid on Christmas. Thx NeoXed, it's working flawless for me now. Just what I wanted. :banana:

This [REQ] has been [FiLLED].
PopWeasel is offline   Reply With Quote
Old 06-06-2004, 11:03 PM   #10
neoxed
Too much time...
FlashFXP Beta Tester
ioFTPD Scripter
 
Join Date: May 2003
Posts: 1,326
Default

No problem, glad I could help.
neoxed is offline   Reply With Quote
Old 06-15-2004, 04:09 AM   #11
PopWeasel
Senior Member
ioFTPD Scripter
 
Join Date: Feb 2004
Posts: 181
Default

Ok it looks like it works fine on XP but not Win2k for some reason. Does Win2k have a different value for the %SYSTEMPATH% env var or .. ?
PopWeasel is offline   Reply With Quote
Reply

Tags
current, dir, files, script, tar

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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 Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Download grinding to a halt bruceh General Discussion 6 09-07-2004 08:29 AM


All times are GMT -5. The time now is 12:25 AM.

Parts of this site powered by vBulletin Mods & Addons from DragonByte Technologies Ltd. (Details)