Hi,
FYI Here are the commands to compress a file/folder on the remote server. Apologies if i am repeating info you already know
- I could not get any test plink commands working using the Dopsus CLI, but they work fine if you use the command bar (thing similar to the filter bar. dunno exact name)
plink -ssh 015_test tar -zcvf /home/username/aiCarambaMoreCheese.tgz /home/username/SomeFile.txt
The anatomy of the command is:
015_test: The name of your saved session.
tar till end of code: the linux command you wish to run and it's associated parameters and options. If you search for man tar on google, you should find the command manual.
In the case of the above command -zcvf means create a compressed file with verbose output. Replacing c with x, makes it "extract", instead of "create". Inclusion or exclusion of -z equates to whether compression (with gzip, j=bzip) is "on" or "off" respectively.
/home/username/aiCarambaMoreCheese.tgz is the name of the file you wish to create.
/home/username/SomeFile.txt = Path to file. If you use absolute paths, your tar file will replicate the folder structure within it. So in order to get relative paths look at example below:
##################
plink command to create a .tgz file on the remote-machine that excludes certain file types:
I have created a test folder structure on the linux-remote machine located at /home/username/brie/test_tar/cheesychips . Contents are:
[ul]In /home/username/brie/test_tar:
cheesychips test10.txt test2.info test3.txt test5.info test6.txt test8.info test9.txt
--exclude=*.txt test1.info test2.txt test4.info test5.txt test7.info test8.txt
test10.info test1.txt test3.info test4.txt test6.info test7.txt test9.info[/ul]
[ul]In /home/username/brie/test_tar/cheesychips:
test20.info test21.txt test23.info test24.txt test26.info test27.txt test29.info test30.txt
test20.txt test22.info test23.txt test25.info test26.txt test28.info test29.txt
test21.info test22.txt test24.info test25.txt test27.info test28.txt test30.info[/ul]
the tar command is recursive by default, so the command:
plink -ssh 015_test cd /home/username/brie ; tar -zcvf /home/username/aiCarambaMoreCheese.tgz --exclude='*.txt' test_tar ; cd -
Will recursively compress everything apart from files with the .txt extension. So you should get only the .info files.
Anatomy of command (actually three linux commands)
a) plink -ssh 015_test :
use the plink command on your windows machine
b) cd /home/username/brie ;
change directory to where the folder you want to compress is. You can get the path of whatever directory you are in the Dopus dest panel and change "/home/username/brie" to ${Doupus-destPath-LinuxFormat}
c) tar -zcvf /home/username/aiCarambaMoreCheese.tgz --exclude='*.txt' test_tar ;
The actual tar command to create a compresed gzip archive. If you want Dopus to do this from any location the following variables need to be created and the command modified as follows:
Probably with path chopping like you have already done or passing of strings (with dopus dlgstring) for exclude file pattern
tar -zcvf ${tgz-save-path}/${tgz-filename}.tgz --exclude='${exclude-File-pattern}' ${tgz-foldername-ToBe-tgz'd}
d) cd -
moves back to previous directory
probably not needed if you are only cd'ing into 1 directory and don't plan to cd again. included in case you are going to do more complicated things.
If you want to exclude more than 1 kind of filename/type, just whack another --exclude='{exclude-File-pattern}' in the command. For more info on this feature of tar, see:
cyberciti.biz/faq/exclude-ce ... r-command/