Skip to content
Advertisement

Tag: sh

Why copy command is not working when using file paths?

I’m having a problem with the copy command. cp ../teste/env/test/x.tar ../../../teste2/file The folders exist and also the file x.tar. When I start the script I’m on a different folder, so that’s why I make a ../ at the begining. It keeps giving me this error: cp: cannot create regular file ‘../../../teste2/file’: No such file or directory Worth to note that

How to open apps from bash (Linux)

Automate part of your life where you can! (It doesn’t seem to be working properly…). This time is for opening multiple apps on my desktop while I make my morning coffee. I created a .sh to open my workspace apps like Visual Code, Slack, Firefox, etc. The script is basically: I basically found the paths to the executable apps and

Shell Script : MongoDB Dump

I’m creating a shell script to automatically dump the database. I have the current code below. The problem is when I’m opening the zip file it shows a single binary file. Usually, when I dump manually it consists of bson and json files. I don’t know what I’m doing wrong I’m expecting a zip file with bson and json file.

pass the date from outside as a parameter

This is my Linux script, I want to ask the user from outside what date is needed, then save that date and run the script for that date. now currently this script generate a csv for the current date files, I want to run this for a user request date, can I pass parameters from outside? any help could be

How to convert this powershell script to bin/sh script?

How to convert this script: or with parameter: How to make similar script that works in linux /bin/sh? I want to copy files to some network location (windows shared folder). There is no scp on windows server and i cannot install anything. Answer On Linux, you’ll need the following (verified on Ubuntu 18.04, albeit not with a Windows domain account):

Need a way to check content of file (time data) is more than 5 minutes or not

I am creating a script to pull out the list of highest cpu consuming jobs on my server. I am taking the dump of processes in a flat file in below format: 202009080230,4.1,218579,padaemon,02:30,00:00:01,SD_RCC_FRU:wf_rcc_ds_CRS_FactSuspendedGdc_d.s_m_rcc_ds_Staging_Dimension_FactSuspendedGdc_ipi_d The second data point(4.1) is my cpu utilization while the sixth one is the time taken(00:00:01). I intend to filter out only the entries from this file

Advertisement