Two Queries: Samba And Usb

Home » CentOS » Two Queries: Samba And Usb
CentOS 1 Comment


I have two distinct queries

1. How to detect removal of external usb hard disk within a script and stop backup?

2. How to emulate vfs_recycle functionality of samba for bare metal linux box using script?

One thought on - Two Queries: Samba And Usb

  • You should know what the path to the external storage is when you have it mounted. Just check the path to see if the directory exists:

    if ( -d “Path to a directory on the mounted volume” ) {
    Run Your Backup;
    } else {
    Take Some Other Action;

    This is perl script, but the same concept will work with shell script with slightly different syntax.