It always helps to consult the man pages (although I have to admit tar 's is quite complex).
For compressing, just add the z option.
For excluding directories, add their names to the exclude file.
tar cvfX /varios/restore/test.tar excludefile.txt /jfma/test1/
compress /varios/restore/test.tar
The f and X options require the following two arguments.
The exclude file must absolutely match e.g. must be /jfma/test1//path/to/file; it is less confusing to omit the trailing slash, i.e. have /jfma/test1 and the exclude file /jfma/test1/path/to/file
I am talking of a standard tar - GNU tar has some default magic to strip leading and trailing slashes.
All in one go, tar to stdout and pipe this to compress:
tar cvfX - excludefile.txt /jfma/test1 | compress > /varios/restore/test.tar.Z
There are variations depending on your OS, which you haven't told us. What OS flavour and version are you using? There are lots to choose from, AIX, HPUX, Solaris, OEL., CentOS, Fedora, RedHat, Suse..........etc.
Some will accept the -z flag as part of the tar command, some will not and you have to pass the output to a compression program afterwards, but the default compression programs can vary depending on your OS too, e.g. compress, gzip, bzip, etc.
If none of the above posts have given you an answer, please post your OS and version and we can find the appropriate process for you.