Packing files via SSH, how to? - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Packing files via SSH, how to? (/showthread.php?tid=10293) |
Packing files via SSH, how to? - El Forum - 07-25-2008 [eluser]Référencement Google[/eluser] Hi, Not CI related, but Linux server related, sorry to post my question on my favorite forum ;-) I need via SSH to make a pack of files (.tar.gz or zip ?) that will keep the CHMOD information, so when I unpack to another server I keep the same rights on folder and files. Is there a way to do that? Packing files via SSH, how to? - El Forum - 07-25-2008 [eluser]Yash[/eluser] if you will execute the file on another server you required different permission compare to your original file permissions. so I guess you have to read permission store it and later save it.You can done all this with php. Packing files via SSH, how to? - El Forum - 07-25-2008 [eluser]Référencement Google[/eluser] That would be a pain doing this with PHP only for a 1 time use (because in fact, I need to export a website on another server, the problem is that there is a lot of files and I don't know where and how are all the permissions) Are you sure there isn't a way to do this by SSH ? Packing files via SSH, how to? - El Forum - 07-25-2008 [eluser]johnwbaxter[/eluser] Yeah sock puppet is spot on. Also, this sort of question should go in the lounge really i reckon. Packing files via SSH, how to? - El Forum - 07-25-2008 [eluser]Référencement Google[/eluser] Quote:Also, this sort of question should go in the lounge really i reckon. You are right, also I wasn't sure were to post it, I am sure nobody won't have a big pain about my post Quote:You are doing this via the command line, and not PHP, right? In this case: man tar. Yes I am under command line... One question about the .tar format, will it keep the CHMOD permissions? (That was the most important for me) Packing files via SSH, how to? - El Forum - 07-25-2008 [eluser]johnwbaxter[/eluser] http://unixhelp.ed.ac.uk/CGI/man-cgi?tar should give you some info, i think using -p should preserve the permissions. Packing files via SSH, how to? - El Forum - 07-25-2008 [eluser]Eric Cope[/eluser] man page for tar tar -czf archive_file_name.tgz directory_or_file_to_archive -c = create a new file -z = compress using gzip, bzip2 is probably available too -f = lists all files in your tar verbosely (I forget what that means to the end user, but I use it all the time to tar up files. to untar it: tar -xzfp archive_file_name.tgz -x = extract (opposite of create) -z = uncompress -f = see above -p = preserve permissions Packing files via SSH, how to? - El Forum - 07-25-2008 [eluser]Référencement Google[/eluser] Great! Many thanks for the help all of you, I will try that tonight. |