belick Posted November 28, 2007 Share Posted November 28, 2007 Hi, I am not sure if this is the right place to ask for help but I will try... I am tring to make a file that can be run by a cronjob on my linux. The file suppose to make a tar file for a specific folder and protect it with a password, then to upload it into FTP server... Any help will be thanksful, Thanks. Quote Link to comment Share on other sites More sharing options...
trq Posted November 28, 2007 Share Posted November 28, 2007 Where exactly are you stuck? Or do you want us to write it? Quote Link to comment Share on other sites More sharing options...
belick Posted November 28, 2007 Author Share Posted November 28, 2007 anything to start with... Quote Link to comment Share on other sites More sharing options...
trq Posted November 28, 2007 Share Posted November 28, 2007 To tar a directory.... tar -cvf file.tar directory gzip file.tar To encrypt the new file using a password (ps: Ive never attempted this with anything other than text files). mcrypt file.tar.gz To ftp the encrypted file to a remote server. ftp put file.tar.gz.nc hostname Quote Link to comment Share on other sites More sharing options...
belick Posted November 28, 2007 Author Share Posted November 28, 2007 Thanks, do I put it in a .pl file? Quote Link to comment Share on other sites More sharing options...
trq Posted November 28, 2007 Share Posted November 28, 2007 Thanks, do I put it in a .pl file? If you write your script in perl. The examples I posted above will fit easily into a bash script. Quote Link to comment Share on other sites More sharing options...
belick Posted November 29, 2007 Author Share Posted November 29, 2007 can you show example of bash script? Quote Link to comment Share on other sites More sharing options...
trq Posted November 29, 2007 Share Posted November 29, 2007 #!/usr/bash tar -cvf file.tar directory gzip file.tar mcrypt file.tar.gz ftp put file.tar.gz.nc hostname Quote Link to comment Share on other sites More sharing options...
steviewdr Posted November 29, 2007 Share Posted November 29, 2007 To be efficient: #To quickly tar and gzip tar -czvf file.gz directory #To quickly untar and ungzip tar -xzvf file.gz Summary: just throw in a z. -steve Quote Link to comment Share on other sites More sharing options...
belick Posted January 16, 2008 Author Share Posted January 16, 2008 Questions: #!/usr/bash tar -cvf file.tar directory gzip file.tar do I must go with zip too? mcrypt file.tar.gz where do I place my pasword? I need to protect the file... ftp put file.tar.gz.nc hostname hostname means the ftp? where is the username and pass? Thanks Quote Link to comment Share on other sites More sharing options...
fert Posted January 16, 2008 Share Posted January 16, 2008 do I must go with zip too? that doesn't make a zip archive, it makes a gzip archive you could go with other formats such as bzip. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.