Тёмный

Linux Bash Shell Realtime Project of Daily Backup Script // Project 1 // EP 1🔥🔥🔥 

Engr. Abhishek Roshan
Подписаться 14 тыс.
Просмотров 3,7 тыс.
50% 1

Опубликовано:

 

1 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 51   
@AbdulBasit-ct6xq
@AbdulBasit-ct6xq 2 месяца назад
Hello sir , Sir i copied your script same as but it execute else statement that backup configuration file not found! But i created a file in archive folder and give permission as well but it execute again else statement and not accessing the file which in archive folder. Kindly tell how i do it?
@saeelsakhalkar9533
@saeelsakhalkar9533 Месяц назад
Would you like share your github link ?
@prasadrr892
@prasadrr892 8 месяцев назад
Please post shellscript
@EngrAbhishekRoshan
@EngrAbhishekRoshan 8 месяцев назад
Sure…soon I will be come up with shell script advanced tutorial or course for everyone.
@ganeshpawar231
@ganeshpawar231 6 месяцев назад
Hi sir , What is that source "$backup_config_file" for validation? you said. What does that mean? Is that command in linux? What if we don't use that validation. Little bit confused Elaborate little bit.... Thanks
@EngrAbhishekRoshan
@EngrAbhishekRoshan 6 месяцев назад
Hi Ganesh, it is not linux "backup_config_file" = is variable name and in Linux to execute a variable we represent variable with "$backup_config_file" and this variable hold the value "/archive/backup_config.txt". When ever you will execute the variable it will look for the file "backup_config.txt" under path /archive.
@moulalid6548
@moulalid6548 4 месяца назад
Hi Sir, Much appreciated to your efforts. I am having small dbts. at if [-f...] and 2>/dev/null $? -eq 0. Could you please expand about my dobts.
@EngrAbhishekRoshan
@EngrAbhishekRoshan 4 месяца назад
The statement appears to be a combination of a shell command involving the -f test operator and the redirection of errors to /dev/null, along with a check on the exit status ($?). To clarify, let's break it down and correct any misunderstandings: if [-f ...]: The -f test operator in the if statement checks if a file exists and is a regular file. The syntax should include spaces around the brackets, like this: if [ -f ... ]. 2>/dev/null: This redirects the standard error (file descriptor 2) to /dev/null, effectively discarding any error messages. $? -eq 0: This checks if the exit status of the previous command is 0, indicating success. Putting this together, here's what a complete, corrected command might look like and how to explain it: if [ -f somefile ] 2>/dev/null; then # Commands to execute if the file exists and is a regular file fi Here's a detailed explanation of each part: if [ -f somefile ]: This checks if somefile exists and is a regular file. The spaces around the brackets are necessary for correct syntax in shell scripting. 2>/dev/null: This redirects any error messages that might be generated by the -f test (for example, if the file path is incorrect or inaccessible) to /dev/null, which is a special file that discards all data written to it. This means that any errors will not be displayed to the user. $? -eq 0: After the if [ -f somefile ] command runs, the exit status $? is checked. If it is 0, this means the test was successful (i.e., the file exists and is a regular file), and the then block will be executed. However, it's unusual to see 2>/dev/null directly within the if statement. Typically, error redirection and checking the exit status are handled separately. Here's a more conventional way to achieve this: if [ -f somefile ] 2>/dev/null; then echo "File exists and is a regular file." else echo "File does not exist or is not a regular file." fi Or, more commonly, you might see error checking handled like this: if [ -f somefile ]; then echo "File exists and is a regular file." else echo "File does not exist or is not a regular file." fi 2>/dev/null This structure makes it clear that the if statement checks the condition, and the redirection ensures that any errors are silenced, with the then or else block executed based on the condition.
@shahulhameed-eo1dc
@shahulhameed-eo1dc 8 месяцев назад
Super content with playlist compare to other RU-vid channel
@EngrAbhishekRoshan
@EngrAbhishekRoshan 8 месяцев назад
Thank you so much for your kind words! I am thrilled to hear that you're super content with our playlist compared to other RU-vid channels. Your support means a lot to me! 😊 If you enjoyed the content, I would be grateful if you could share it with your friends, family, and followers. Your help in spreading the word will contribute greatly to the growth of our channel. Thank you for being part of our community and helping me to reach more people! 🚀🎶
@lokanathyedumalla
@lokanathyedumalla 6 месяцев назад
how to take backup directory tell me sir
@EngrAbhishekRoshan
@EngrAbhishekRoshan 6 месяцев назад
#!/bin/bash # Define the directory to be backed up backup_source="/path/to/source_directory" # Define the directory where backups will be stored backup_destination="/path/to/backup_directory" # Create a timestamp for the backup directory name timestamp=$(date +'%Y%m%d%H%M%S') # Create the backup directory backup_directory="$backup_destination/backup_$timestamp" mkdir -p "$backup_directory" # Copy the contents of the source directory to the backup directory cp -r "$backup_source"/* "$backup_directory" # Optionally, you can compress the backup directory # tar -czf "$backup_directory.tar.gz" "$backup_directory" echo "Backup of '$backup_source' completed. Files stored in '$backup_directory'."
@lokanathyedumalla
@lokanathyedumalla 6 месяцев назад
how to take multiple files backup sir
@EngrAbhishekRoshan
@EngrAbhishekRoshan 6 месяцев назад
#!/bin/bash # Check if backup directory exists, create if not backup_dir="backup" if [ ! -d "$backup_dir" ]; then mkdir "$backup_dir" echo "Created backup directory: $backup_dir" fi # Loop through each file and take backup for file in "$@"; do if [ -f "$file" ]; then # Extract filename and extension filename=$(basename -- "$file") extension="${filename##*.}" filename="${filename%.*}" # Get current timestamp timestamp=$(date +"%Y%m%d%H%M%S") # Construct backup filename with timestamp backup_filename="$filename-$timestamp.$extension" # Copy file to backup directory cp "$file" "$backup_dir/$backup_filename" echo "Backup created: $backup_dir/$backup_filename" else echo "File not found: $file" fi done
@rutikabudar359
@rutikabudar359 8 месяцев назад
yes, please upload details shell scripting video
@EngrAbhishekRoshan
@EngrAbhishekRoshan 8 месяцев назад
Sure.
@cva1978
@cva1978 8 месяцев назад
Subscribed today and your videos are really awesome and thanks for making videos for us sir.
@EngrAbhishekRoshan
@EngrAbhishekRoshan 8 месяцев назад
Welcome aboard!
@cva1978
@cva1978 8 месяцев назад
@@EngrAbhishekRoshan thanks for the kind reply sir. Now also watching your video only for my today’s SRE interview
@EngrAbhishekRoshan
@EngrAbhishekRoshan 8 месяцев назад
Best of Luck .....God Bless You.
@Khaira-Official
@Khaira-Official 8 месяцев назад
Very informative stuff, Please create one video on RHEL Server Clustering
@EngrAbhishekRoshan
@EngrAbhishekRoshan 8 месяцев назад
"Thank you for your feedback! I'm thrilled to hear that you found the content informative. Your suggestion for a video on RHEL Server Clustering is fantastic, and I truly appreciate your input. I'll definitely take that into consideration, and you can expect a video on that topic in the near future. Stay tuned for more valuable content, and your engagement and suggestion!"
@Bangbang56817
@Bangbang56817 8 месяцев назад
Can you share some projects to show in Linux admin freshers resume & AWS freshers resume
@EngrAbhishekRoshan
@EngrAbhishekRoshan 8 месяцев назад
Check this video already their in my playlist for linux fresher and AWS fresher resume I will publish soon. ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-CVkG5UGIyis.html
@saruyadavloveujindgi8496
@saruyadavloveujindgi8496 8 месяцев назад
Yes sir, please continue this series.. Thank you so much sir... I was waiting to start bash shall scripting that when will you start ___now finely you have started this....😊
@EngrAbhishekRoshan
@EngrAbhishekRoshan 8 месяцев назад
As soon as possible will roll out the videos.
@kashifbaig6793
@kashifbaig6793 8 месяцев назад
Thanks for this and please make video on bash scripting
@EngrAbhishekRoshan
@EngrAbhishekRoshan 8 месяцев назад
Welcome and Sure..
@diyalifestyles6971
@diyalifestyles6971 8 месяцев назад
Yes, pls do advanced shell scripting series. Also, expecting az Devops (or Devops) for Senior Devops engineer pls for looking for job change pls
@EngrAbhishekRoshan
@EngrAbhishekRoshan 8 месяцев назад
Sure ....more videos of Shell scripting is in pipeline and I have also aws and devops tools video with Realtime project is in pipeline. I am working on everyone request to fulfil soon. Share these videos with more and people so that we can grow this channel faster and i can focus more towards RU-vid.
@diyalifestyles6971
@diyalifestyles6971 8 месяцев назад
@@EngrAbhishekRoshan than you waiting eagerly :)
@Dineshsa-wb9eq
@Dineshsa-wb9eq 4 месяца назад
Perfect one and am learning a lot from your channel, thank you so much
@EngrAbhishekRoshan
@EngrAbhishekRoshan 4 месяца назад
You're very welcome!
@fahadbawazir1771
@fahadbawazir1771 8 месяцев назад
Sir also post Linux skills for Data center professionals
@EngrAbhishekRoshan
@EngrAbhishekRoshan 8 месяцев назад
Sure I will
@ArpitTyagi-bx5hq
@ArpitTyagi-bx5hq 8 месяцев назад
Sir please post or make video at shell scripting
@EngrAbhishekRoshan
@EngrAbhishekRoshan 8 месяцев назад
Sure …thank you for showing interest for shell script tutorials/course.100% I will start the playlist soon.
@anandsrivastava8734
@anandsrivastava8734 8 месяцев назад
Thanks a lot for your videos. Please do roll out shell script series
@EngrAbhishekRoshan
@EngrAbhishekRoshan 8 месяцев назад
Welcome .........Sure will roll out ASAP.
@VirendraYadav-mu6ye
@VirendraYadav-mu6ye 6 месяцев назад
Thanks for sharing script video Sir
@EngrAbhishekRoshan
@EngrAbhishekRoshan 6 месяцев назад
Most welcome
@shivasanthosh9081
@shivasanthosh9081 8 месяцев назад
Please make videos on shell script
@EngrAbhishekRoshan
@EngrAbhishekRoshan 8 месяцев назад
sure
@sunilchavan4915
@sunilchavan4915 8 месяцев назад
Yes we have need shell scripting
@EngrAbhishekRoshan
@EngrAbhishekRoshan 8 месяцев назад
sure
@chandersharma1622
@chandersharma1622 8 месяцев назад
Nice SIr great video
@EngrAbhishekRoshan
@EngrAbhishekRoshan 8 месяцев назад
Thanks and welcome
@TanwarG1008
@TanwarG1008 8 месяцев назад
Thank you sir
@EngrAbhishekRoshan
@EngrAbhishekRoshan 8 месяцев назад
Welcome
@AmitDere-k3r
@AmitDere-k3r 8 месяцев назад
please start shell scrip playlist from basic to advanced please asap.
@EngrAbhishekRoshan
@EngrAbhishekRoshan 8 месяцев назад
Sure Amit …keep sharing and keep watching
Далее
BASH scripting will change your life
14:18
Просмотров 1 млн
OYUNCAK DİREKSİYON İLE ARABAYI SÜRDÜ 😱
00:16
Linux from Scratch
2:35:42
Просмотров 184 тыс.
Exception Handling In One Video | Java
2:41:46
Hyprland Rices and COSMIC First Look
2:43:03
Просмотров 20 тыс.
The Value of Source Code
17:46
Просмотров 40 тыс.