SUSE 11. I have issued the command "gzip -r -c directory > archive.gz" over a complete directory tree. I've got no errors or warnings. I can decompress the gz file also without errors, but what I get is a single file which is the concat of all of the original files, including binaries, without posibility of splitting them into the original ones.
I suppose I've lost my files, no?.
Secondary question: why does gzip let me issue that destructive command?
Hello, I have an embedded linux device. I can connect to the device and I can upload or download files. No problem with this. But, at first connection, I want to connect to "/" directory instead of "/root". In the device file system, there are files ssh_config and sshd_config under /etc/ssh directory. I think I have to do something with these files but I don't know what.
I don't exactly know what mean "/root" and "/" directories. I think that the real root directory is "/" directory which is empty but when I connect with filezilla, the "/root" directory is the default so I had to go back to / directory everytime.
Hello everyone;
At this time I need to make a sh script to make a db backup an send it to another server.
Thinking about this, I think I have to:
1.- Make a connection beetween the servers without password
2.- The scrip must to do:
a.- Make the mysqldump
b.- Put it in a gzip file
c.- Send througth scp the gzip file and ONLY when the copy has done the script have to delete the files that are 3 days old.
Could you help me with this?
Do you consider that is a good idea or you have a better one?
Thanks in advance.
I copied the following from my linux console.
grep -lr "SMTP" *.ini
grep: *.ini: No such file or directory
I wanted to search recursively under current location in files with extenstion .ini
Actually there are files that contain "SMTP" under this directory. But I got the above error message.
What is wrong? I am using centos 6.
Thanks,
3rock
Hello everyone!
Can anyone help me in how to work the chmod command?
Suppose that you have a directory of udir12, a subdirectory udir121 (under udir12) and a file called file131 under directory udir121.
How do you change permission for the directory udir12 and all subdirectory and files to 770?
Can anyone help me out please!!!
Thanks
Carlos
Stupid question i know. I am trying to install some brother printer drivers and following the instructions it states that i must change to the directory where the file is stored by using the following command line "cd /home/(loginname)/downloads"
this comes back with unkown directory. When i use DIR the directory is there but it will not allow me to access it?
This has worked before. I have been using linux now for a few years and never had this problem before. It must be something stupid that I am doing.
hello all,
please help me with python ftplib. i was trying to copy files from my linux machine to a windows server using ftplib. everything was working good. but i'm only able to copy files from the same directory the script is. how do i copy files from a different directory? i always get "file not found error message". here's my code :
Code:
tester_name = str (socket.gethostname())
def upload(ftp, file):
ext = os.path.splitext(file)[1]
if ext in (".txt", ".htm", ".html"):
ftp.storlines("STOR " + file, open(file))
else:
ftp.storbinary("STOR " + file, open(file, "rb"), 1024)
parse_source_path = ('/path/to/where/i/go/')
parse_source_file_list = os.listdir(parse_source_path)
ftp = ftplib.FTP("server_IP")
ftp.login("username", "pass")
folder_list = []
ftp.dir(folder_list.append)
if str(tester_name) not in str(folder_list) :
ftp.mkd("%s"%tester_name)
ftp.cwd("%s"%tester_name)
for files in parse_source_file_list :
print files
upload(ftp, files)
else :
print "later"
hey guys,
Let's say I want to find out which log files have related ntp information in them. I use cat and grep to search through the files in /var/log and then export that to a file. this is the command...
# cat /var/log/* | grep ntp > /home/log.txt
The file created from this command will not include the directories the log entries are apart of. Why not? For example, if you do this same command without exporting to the /home/log.txt file it will show you in stdout which directory each log entry is in. Hope I'm making sense here. My question is, is there a clever way to export to a file in a way so that the file created is structured exactly like the stdout of the command below?
# cat /var/log/* | grep ntp
Hello all.
I have 100 sub-directories that "rar" files exist in them, How can I move all rar files into parent directory?
I used "find sourcedir -type f -exec mv {} targetdir \; " but i just copy one file and all files deleted
Thank you.
Hi guys
We are trying to move Oracle applications database tier archive, that is 111GB (over Linux) to a USB external drive using cp. Though the file successfully gets transferred to the external drive, trying to extract the file from a 2nd machine always fails, saying the archive is corrupt.
We have checked the integrity of the archive using 7-zip, reporting no errors. However totally frustrated as our last few attempts were totally futile.
The interesting part is, if we do scp to transfer the file to 2nd machine, extraction doesn't fail.
Please let us know, how we can successfully move this archive to the 2nd machine which is at a remote location and no possibilities of setting up a FTP for such a huge size file.
Both the source and destination Linux distros are RHEL 5 Enterprise, 64Bit, ext3 file systems.
regards,
Hello.
How can I Generate the files name in a directory into a TXT file? I mean is create a list if files.
Tnx.