My server is using CentOS 5.5 (which is almost red hat linux).
I will create a set of images in backup time stamped files, this code will work:
z_cmd1 = $ (tar cvzf / home / user1 / public_ftp / Misc / pics_20100925_142230.tar.gz / home / user1 / public_html / misc / _pics_var / F.exejpg) "Output Output =" [[$ {z_cmd1}] "
resonates, but of course I want time stamp to be automatic.
The following code does not work, in some way, the third line (one with the tar) fails The 'wire' does something, but it does not need any fonts on the desired destination folder. Why?
z_fname = $ (date + "/ home / user1 / public_ftp / misc / pics_% Y% m% d_% H% M% S. Tar.gz ")" File name = [$ {z_fname}] "z_cmd1 = $ (tar cvzf $ {z_fname} /home/user1/public_html/misc/_pics_var/Fethod-+.jpg)" res output = [$ {Z_cmd1}] "
Thank you.
< P> Try it like this:
mydate = 'date + "% m-% d-% Y" `; Input = ". / Home / user1 / public_html / Miscellaneous / _pics_var / F JPG"; Production = "/ home / user1 / public_ftp / various / pics_ $ mydate.tar.gz"; Tar cvzf $ Output IN input & amp; Amp; Echo "$ output successfully created"! if [ ! $? == 0]; Then echo "$ output failed"; Fi;
We make a date in the form of variables. Using the date variable in the output variable, we create input and output variables. Then execute the command and check whether it is executed without any errors.
Comments
Post a Comment